Files
youlegames/codes/games/server/youle/server_agent/class.import.js
2026-02-04 23:47:45 +08:00

127 lines
4.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
///////////////////////////////////////////////////
/////// cls_youle_agent_import: 输入接口 ///////
///////////////////////////////////////////////////
var cls_youle_agent_import = cls_youle_agent_import || {
new: function() {
var imp = {};
//创建房间时根据roomtype获取需要的房卡数量
imp.createroom_needroomcard = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.get_needroomcard){
return mod_game.export.get_needroomcard(roomtype, o_game_config);
}
}
if (mod_game.needroomcard){
return mod_game.needroomcard(roomtype, o_game_config);
}
return 1;
}
//创建房间时根据roomtype获取总局数
imp.createroom_asetcount = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.get_asetcount){
return mod_game.export.get_asetcount(roomtype, o_game_config);
}
}
if (mod_game.asetcount){
return mod_game.asetcount(roomtype, o_game_config);
}
return 8;
}
//创建房间时根据roomtype获取元宝下限
imp.createroom_beanfloor = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.createroom_beanfloor){
return mod_game.export.createroom_beanfloor(roomtype, o_game_config);
}
}
if (mod_game.createroom_beanfloor){
return mod_game.createroom_beanfloor(roomtype, o_game_config);
}
return null;
}
//创建房间时根据roomtype获取房间类型是否是元宝房间
imp.createroom_roommode = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.createroom_roommode){
return mod_game.export.createroom_roommode(roomtype, o_game_config);
}
}
if (mod_game.createroom_roommode){
return mod_game.createroom_roommode(roomtype, o_game_config);
}
return 0;
}
//创建房间时根据roomtype获取星星场倍数
imp.createroom_beanmult = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.createroom_beanmult){
return mod_game.export.createroom_beanmult(roomtype, o_game_config);
}
}
if (mod_game.createroom_beanmult){
return mod_game.createroom_beanmult(roomtype, o_game_config);
}
return 1;
}
//房间内的玩家是否需要准备
imp.createroom_needprepare = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.createroom_needprepare){
return mod_game.export.createroom_needprepare(roomtype, o_game_config);
}
}
if (mod_game.createroom_needprepare){
return mod_game.createroom_needprepare(roomtype, o_game_config);
}
return 0;
}
//加入房间时根据roomtype获取需要的房卡数量如果不需要房卡则需要返回0
imp.joinroom_needroomcard = function(o_game, roomtype){
var o_game_config = youle_agent.app.youle_platform.config.method.get_paravalue("game_config", o_game.o_agent.agentid, o_game.gameid);
var mod_game = youle_agent.app[o_game.modename];
if (mod_game.export){
if (mod_game.export.get_needroomcard_joinroom){
return mod_game.export.get_needroomcard_joinroom(roomtype, o_game_config);
}
}
if (mod_game.needroomcard_joinroom){
return mod_game.needroomcard_joinroom(roomtype, o_game_config);
}
return 0;
}
return imp;
}
}
//内部输入接口
youle_agent.import = cls_youle_agent_import.new();