public ROOM_PUBLIC_INFO createFromStreamEx(MemoryStream stream) { ROOM_PUBLIC_INFO datas = new ROOM_PUBLIC_INFO(); datas.state = stream.readUnicode(); datas.playerInfo = playerInfo_DataType.createFromStreamEx(stream); datas.button = stream.readInt8(); datas.turn = stream.readInt8(); return(datas); }
public PLAYER_INFOS createFromStreamEx(MemoryStream stream) { PLAYER_INFOS datas = new PLAYER_INFOS(); datas.id = stream.readInt32(); datas.name = stream.readUnicode(); datas.winCount = stream.readUint16(); datas.loseCount = stream.readUint16(); datas.isReady = stream.readInt8(); datas.seatIndex = stream.readInt8(); datas.isRoomMaster = stream.readInt8(); return(datas); }
public ROOM_PUBLIC_INFO createFromStreamEx(MemoryStream stream) { ROOM_PUBLIC_INFO datas = new ROOM_PUBLIC_INFO(); datas.RoomType = stream.readUint8(); datas.playerMaxCount = stream.readUint8(); datas.state = stream.readUnicode(); datas.turn = stream.readInt8(); datas.numOfMJ = stream.readUint8(); datas.button = stream.readInt8(); datas.playerInfo = playerInfo_DataType.createFromStreamEx(stream); datas.chuPai = stream.readInt8(); return(datas); }
public PLAYER_PUBLIC_INFO createFromStreamEx(MemoryStream stream) { PLAYER_PUBLIC_INFO datas = new PLAYER_PUBLIC_INFO(); datas.userId = stream.readUint32(); datas.folds = folds_DataType.createFromStreamEx(stream); datas.angangs = angangs_DataType.createFromStreamEx(stream); datas.diangangs = diangangs_DataType.createFromStreamEx(stream); datas.wangangs = wangangs_DataType.createFromStreamEx(stream); datas.pengs = pengs_DataType.createFromStreamEx(stream); datas.hus = hus_DataType.createFromStreamEx(stream); datas.que = stream.readInt8(); datas.holdsCount = stream.readInt8(); return(datas); }
public PLAYER_PUBLIC_INFO createFromStreamEx(MemoryStream stream) { PLAYER_PUBLIC_INFO datas = new PLAYER_PUBLIC_INFO(); datas.userId = stream.readUint32(); datas.holdsCount = stream.readInt8(); return(datas); }
public AVATAR_DATA createFromStreamEx(MemoryStream stream) { AVATAR_DATA datas = new AVATAR_DATA(); datas.param1 = stream.readInt8(); datas.param2 = stream.readBlob(); return(datas); }
public override void onUpdatePropertys(UInt16 propUtype, MemoryStream stream, int maxCount) { ScriptModule sm = EntityDef.moduledefs["FrameSyncReport"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0 && maxCount-- != 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = propUtype; if (_t_child_utype == 0) { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; prop = pdatas[_t_child_utype]; switch (prop.properUtype) { case 19: SByte oldval_seatNo = seatNo; seatNo = stream.readInt8(); if (prop.isBase()) { if (owner.inited) { onSeatNoChanged(oldval_seatNo); } } else { if (owner.inWorld) { onSeatNoChanged(oldval_seatNo); } } break; default: break; } ; } }
public override void onRemoteMethodCall(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Account"]; UInt16 methodUtype = 0; UInt16 componentPropertyUType = 0; if (sm.useMethodDescrAlias) { componentPropertyUType = stream.readUint8(); methodUtype = stream.readUint8(); } else { componentPropertyUType = stream.readUint16(); methodUtype = stream.readUint16(); } Method method = null; if (componentPropertyUType == 0) { method = sm.idmethods[methodUtype]; } else { Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (method.methodUtype) { case 3: SByte onEnterGameFailed_arg1 = stream.readInt8(); onEnterGameFailed(onEnterGameFailed_arg1); break; case 4: onEnterGameSuccess(); break; case 5: string onFirstEntityHello_arg1 = stream.readUnicode(); onFirstEntityHello(onFirstEntityHello_arg1); break; default: break; } ; }
public D_MATCH_REQUEST createFromStreamEx(MemoryStream stream) { D_MATCH_REQUEST datas = new D_MATCH_REQUEST(); datas.utype = stream.readUint32(); datas.matchID = stream.readUint64(); datas.passwd = stream.readUint32(); datas.teamID = stream.readInt8(); return(datas); }
public SPACE_INFO createFromStreamEx(MemoryStream stream) { SPACE_INFO datas = new SPACE_INFO(); datas.space_key = stream.readUint64(); datas.player_count = stream.readUint8(); datas.space_state = stream.readInt8(); datas.space_creater = stream.readInt32(); return(datas); }
public ROOM_INFO createFromStreamEx(MemoryStream stream) { ROOM_INFO datas = new ROOM_INFO(); datas.room_key = stream.readUint64(); datas.player_count = stream.readUint8(); datas.room_state = stream.readInt8(); datas.room_creater = stream.readInt32(); return(datas); }
public PLAYER_ACTION_DIC createFromStreamEx(MemoryStream stream) { PLAYER_ACTION_DIC datas = new PLAYER_ACTION_DIC(); datas.pai = stream.readInt8(); datas.hu = stream.readUint8(); datas.peng = stream.readUint8(); datas.gang = stream.readUint8(); datas.gangpai = gangpai_DataType.createFromStreamEx(stream); return(datas); }
public BAN_INFOS createFromStreamEx(MemoryStream stream) { BAN_INFOS datas = new BAN_INFOS(); datas.dbid = stream.readInt32(); datas.accountId = stream.readInt32(); datas.startTime = stream.readUnicode(); datas.finishTime = stream.readUnicode(); datas.reason = stream.readUnicode(); datas.state = stream.readInt8(); return(datas); }
public MJ_LIST createFromStreamEx(MemoryStream stream) { UInt32 size = stream.readUint32(); MJ_LIST datas = new MJ_LIST(); while (size > 0) { --size; datas.Add(stream.readInt8()); } ; return(datas); }
public ENTITY_FORBID_COUNTER createFromStreamEx(MemoryStream stream) { UInt32 size = stream.readUint32(); ENTITY_FORBID_COUNTER datas = new ENTITY_FORBID_COUNTER(); while (size > 0) { --size; datas.Add(stream.readInt8()); } ; return(datas); }
static int readInt8(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); KBEngine.MemoryStream obj = (KBEngine.MemoryStream)ToLua.CheckObject <KBEngine.MemoryStream>(L, 1); sbyte o = obj.readInt8(); LuaDLL.lua_pushnumber(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void Client_onUpdateData_p(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); SByte p = stream.readInt8(); _updateVolatileData(eid, 0.0f, 0.0f, 0.0f, KBE_FLT_MAX, p, KBE_FLT_MAX); }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["FrameSyncMgr"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 40002: stream.readUint32(); break; case 23: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; default: break; } ; } }
public void Client_onUpdateData_xz_ypr(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); Vector2 xz = stream.readPackXZ(); SByte y = stream.readInt8(); SByte p = stream.readInt8(); SByte r = stream.readInt8(); _updateVolatileData(eid, xz.X, 0.0f, xz.Y, y, p, r, 1); }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Monster"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 47001: Int32 oldval_HP = HP; HP = stream.readInt32(); if (prop.isBase()) { if (inited) { onHPChanged(oldval_HP); } } else { if (inWorld) { onHPChanged(oldval_HP); } } break; case 47002: Int32 oldval_HP_Max = HP_Max; HP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onHP_MaxChanged(oldval_HP_Max); } } else { if (inWorld) { onHP_MaxChanged(oldval_HP_Max); } } break; case 47003: Int32 oldval_MP = MP; MP = stream.readInt32(); if (prop.isBase()) { if (inited) { onMPChanged(oldval_MP); } } else { if (inWorld) { onMPChanged(oldval_MP); } } break; case 47004: Int32 oldval_MP_Max = MP_Max; MP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onMP_MaxChanged(oldval_MP_Max); } } else { if (inWorld) { onMP_MaxChanged(oldval_MP_Max); } } break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 51007: UInt32 oldval_entityNO = entityNO; entityNO = stream.readUint32(); if (prop.isBase()) { if (inited) { onEntityNOChanged(oldval_entityNO); } } else { if (inWorld) { onEntityNOChanged(oldval_entityNO); } } break; case 47005: Int32 oldval_forbids = forbids; forbids = stream.readInt32(); if (prop.isBase()) { if (inited) { onForbidsChanged(oldval_forbids); } } else { if (inWorld) { onForbidsChanged(oldval_forbids); } } break; case 41006: UInt32 oldval_modelID = modelID; modelID = stream.readUint32(); if (prop.isBase()) { if (inited) { onModelIDChanged(oldval_modelID); } } else { if (inWorld) { onModelIDChanged(oldval_modelID); } } break; case 41007: Byte oldval_modelScale = modelScale; modelScale = stream.readUint8(); if (prop.isBase()) { if (inited) { onModelScaleChanged(oldval_modelScale); } } else { if (inWorld) { onModelScaleChanged(oldval_modelScale); } } break; case 32: Byte oldval_moveSpeed = moveSpeed; moveSpeed = stream.readUint8(); if (prop.isBase()) { if (inited) { onMoveSpeedChanged(oldval_moveSpeed); } } else { if (inWorld) { onMoveSpeedChanged(oldval_moveSpeed); } } break; case 41003: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 40002: stream.readUint32(); break; case 47006: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; case 47007: Byte oldval_subState = subState; subState = stream.readUint8(); if (prop.isBase()) { if (inited) { onSubStateChanged(oldval_subState); } } else { if (inWorld) { onSubStateChanged(oldval_subState); } } break; case 41004: UInt32 oldval_uid = uid; uid = stream.readUint32(); if (prop.isBase()) { if (inited) { onUidChanged(oldval_uid); } } else { if (inWorld) { onUidChanged(oldval_uid); } } break; case 41005: UInt32 oldval_utype = utype; utype = stream.readUint32(); if (prop.isBase()) { if (inited) { onUtypeChanged(oldval_utype); } } else { if (inWorld) { onUtypeChanged(oldval_utype); } } break; default: break; } ; } }
public void Client_onUpdateData_xyz_yr(MemoryStream stream) { Int32 eid = stream.readInt32(); Vector2 xz = stream.readPackXZ(); float y = stream.readPackY(); SByte yaw = stream.readInt8(); SByte r = stream.readInt8(); _updateVolatileData(eid, xz[0], y, xz[1], yaw, KBE_FLT_MAX, r); }
public void Client_onUpdateData_ypr(MemoryStream stream) { Int32 eid = stream.readInt32(); SByte y = stream.readInt8(); SByte p = stream.readInt8(); SByte r = stream.readInt8(); _updateVolatileData(eid, 0.0f, 0.0f, 0.0f, y, p, r); }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Avatar"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 5: Byte oldval_level = level; level = stream.readUint8(); if (prop.isBase()) { if (inited) { onLevelChanged(oldval_level); } } else { if (inWorld) { onLevelChanged(oldval_level); } } break; case 4: Int32 oldval_mass = mass; mass = stream.readInt32(); if (prop.isBase()) { if (inited) { onMassChanged(oldval_mass); } } else { if (inWorld) { onMassChanged(oldval_mass); } } break; case 9: Byte oldval_modelID = modelID; modelID = stream.readUint8(); if (prop.isBase()) { if (inited) { onModelIDChanged(oldval_modelID); } } else { if (inWorld) { onModelIDChanged(oldval_modelID); } } break; case 7: float oldval_modelScale = modelScale; modelScale = stream.readFloat(); if (prop.isBase()) { if (inited) { onModelScaleChanged(oldval_modelScale); } } else { if (inWorld) { onModelScaleChanged(oldval_modelScale); } } break; case 6: float oldval_moveSpeed = moveSpeed; moveSpeed = stream.readFloat(); if (prop.isBase()) { if (inited) { onMoveSpeedChanged(oldval_moveSpeed); } } else { if (inWorld) { onMoveSpeedChanged(oldval_moveSpeed); } } break; case 2: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 40002: stream.readUint32(); break; case 8: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; default: break; } ; } }
public override object createFromStream(MemoryStream stream) { return stream.readInt8(); }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Avatar"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { case 17: componentFrameSync.onUpdatePropertys(_t_child_utype, stream, -1); break; default: break; } return; } switch (prop.properUtype) { case 17: componentFrameSync.createFromStream(stream); break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 13: SByte oldval_gameStateC = gameStateC; gameStateC = stream.readInt8(); if (prop.isBase()) { if (inited) { onGameStateCChanged(oldval_gameStateC); } } else { if (inWorld) { onGameStateCChanged(oldval_gameStateC); } } break; case 5: Int32 oldval_heroId = heroId; heroId = stream.readInt32(); if (prop.isBase()) { if (inited) { onHeroIdChanged(oldval_heroId); } } else { if (inWorld) { onHeroIdChanged(oldval_heroId); } } break; case 15: SByte oldval_level = level; level = stream.readInt8(); if (prop.isBase()) { if (inited) { onLevelChanged(oldval_level); } } else { if (inWorld) { onLevelChanged(oldval_level); } } break; case 3: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 12: SByte oldval_roundCount = roundCount; roundCount = stream.readInt8(); if (prop.isBase()) { if (inited) { onRoundCountChanged(oldval_roundCount); } } else { if (inWorld) { onRoundCountChanged(oldval_roundCount); } } break; case 14: SByte oldval_seatNo = seatNo; seatNo = stream.readInt8(); if (prop.isBase()) { if (inited) { onSeatNoChanged(oldval_seatNo); } } else { if (inWorld) { onSeatNoChanged(oldval_seatNo); } } break; case 40002: stream.readUint32(); break; case 9: Int32 oldval_teamId = teamId; teamId = stream.readInt32(); if (prop.isBase()) { if (inited) { onTeamIdChanged(oldval_teamId); } } else { if (inWorld) { onTeamIdChanged(oldval_teamId); } } break; case 11: SByte oldval_winRate = winRate; winRate = stream.readInt8(); if (prop.isBase()) { if (inited) { onWinRateChanged(oldval_winRate); } } else { if (inWorld) { onWinRateChanged(oldval_winRate); } } break; default: break; } ; } }
public override void onUpdatePropertys(UInt16 propUtype, MemoryStream stream, int maxCount) { ScriptModule sm = EntityDef.moduledefs["Operation"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0 && maxCount-- != 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = propUtype; if (_t_child_utype == 0) { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; prop = pdatas[_t_child_utype]; switch (prop.properUtype) { case 10: SByte oldval_isWathcher = isWathcher; isWathcher = stream.readInt8(); if (prop.isBase()) { if (owner.inited) { onIsWathcherChanged(oldval_isWathcher); } } else { if (owner.inWorld) { onIsWathcherChanged(oldval_isWathcher); } } break; case 9: Int32 oldval_lossScore = lossScore; lossScore = stream.readInt32(); if (prop.isBase()) { if (owner.inited) { onLossScoreChanged(oldval_lossScore); } } else { if (owner.inWorld) { onLossScoreChanged(oldval_lossScore); } } break; case 7: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (owner.inited) { onStateChanged(oldval_state); } } else { if (owner.inWorld) { onStateChanged(oldval_state); } } break; case 8: Int32 oldval_winScore = winScore; winScore = stream.readInt32(); if (prop.isBase()) { if (owner.inited) { onWinScoreChanged(oldval_winScore); } } else { if (owner.inWorld) { onWinScoreChanged(oldval_winScore); } } break; default: break; } ; } }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Account"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 16: ITEM_LIST oldval_bagItemList = bagItemList; bagItemList = ((DATATYPE_ITEM_LIST)EntityDef.id2datatypes[23]).createFromStreamEx(stream); if (prop.isBase()) { if (inited) { onBagItemListChanged(oldval_bagItemList); } } else { if (inWorld) { onBagItemListChanged(oldval_bagItemList); } } break; case 17: EQUIP_DICT oldval_currentItemDict = currentItemDict; currentItemDict = ((DATATYPE_EQUIP_DICT)EntityDef.id2datatypes[24]).createFromStreamEx(stream); if (prop.isBase()) { if (inited) { onCurrentItemDictChanged(oldval_currentItemDict); } } else { if (inWorld) { onCurrentItemDictChanged(oldval_currentItemDict); } } break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 8: Int32 oldval_gold = gold; gold = stream.readInt32(); if (prop.isBase()) { if (inited) { onGoldChanged(oldval_gold); } } else { if (inWorld) { onGoldChanged(oldval_gold); } } break; case 3: SByte oldval_lastLoginDate = lastLoginDate; lastLoginDate = stream.readInt8(); if (prop.isBase()) { if (inited) { onLastLoginDateChanged(oldval_lastLoginDate); } } else { if (inWorld) { onLastLoginDateChanged(oldval_lastLoginDate); } } break; case 7: Int16 oldval_lastLoginDayLoginTimes = lastLoginDayLoginTimes; lastLoginDayLoginTimes = stream.readInt16(); if (prop.isBase()) { if (inited) { onLastLoginDayLoginTimesChanged(oldval_lastLoginDayLoginTimes); } } else { if (inWorld) { onLastLoginDayLoginTimesChanged(oldval_lastLoginDayLoginTimes); } } break; case 5: Int16 oldval_lastLoginDayPlayTime = lastLoginDayPlayTime; lastLoginDayPlayTime = stream.readInt16(); if (prop.isBase()) { if (inited) { onLastLoginDayPlayTimeChanged(oldval_lastLoginDayPlayTime); } } else { if (inWorld) { onLastLoginDayPlayTimeChanged(oldval_lastLoginDayPlayTime); } } break; case 2: string oldval_nameS = nameS; nameS = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameSChanged(oldval_nameS); } } else { if (inWorld) { onNameSChanged(oldval_nameS); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 13: Int32 oldval_progress = progress; progress = stream.readInt32(); if (prop.isBase()) { if (inited) { onProgressChanged(oldval_progress); } } else { if (inWorld) { onProgressChanged(oldval_progress); } } break; case 15: Int32 oldval_roomNo = roomNo; roomNo = stream.readInt32(); if (prop.isBase()) { if (inited) { onRoomNoChanged(oldval_roomNo); } } else { if (inWorld) { onRoomNoChanged(oldval_roomNo); } } break; case 40002: stream.readUint32(); break; case 6: Int16 oldval_totalLoginTimes = totalLoginTimes; totalLoginTimes = stream.readInt16(); if (prop.isBase()) { if (inited) { onTotalLoginTimesChanged(oldval_totalLoginTimes); } } else { if (inWorld) { onTotalLoginTimesChanged(oldval_totalLoginTimes); } } break; case 4: Int16 oldval_totalPlayTime = totalPlayTime; totalPlayTime = stream.readInt16(); if (prop.isBase()) { if (inited) { onTotalPlayTimeChanged(oldval_totalPlayTime); } } else { if (inWorld) { onTotalPlayTimeChanged(oldval_totalPlayTime); } } break; default: break; } ; } }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Avatar"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { case 17: compMatchAvatar.onUpdatePropertys(_t_child_utype, stream, -1); break; case 8: component1.onUpdatePropertys(_t_child_utype, stream, -1); break; case 11: component2.onUpdatePropertys(_t_child_utype, stream, -1); break; case 15: component3.onUpdatePropertys(_t_child_utype, stream, -1); break; default: break; } return; } switch (prop.properUtype) { case 17: compMatchAvatar.createFromStream(stream); break; case 8: component1.createFromStream(stream); break; case 11: component2.createFromStream(stream); break; case 15: component3.createFromStream(stream); break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 4: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 40002: stream.readUint32(); break; case 7: SByte oldval_teamID = teamID; teamID = stream.readInt8(); if (prop.isBase()) { if (inited) { onTeamIDChanged(oldval_teamID); } } else { if (inWorld) { onTeamIDChanged(oldval_teamID); } } break; default: break; } ; } }
public void Client_onUpdateData_xyz_ypr(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); Vector2 xz = stream.readPackXZ(); float y = stream.readPackY(); SByte yaw = stream.readInt8(); SByte p = stream.readInt8(); SByte r = stream.readInt8(); _updateVolatileData(eid, xz[0], y, xz[1], yaw, p, r); }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Weapon"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 51003: UInt16 oldval_CD = CD; CD = stream.readUint16(); if (prop.isBase()) { if (inited) { onCDChanged(oldval_CD); } } else { if (inWorld) { onCDChanged(oldval_CD); } } break; case 51001: UInt16 oldval_attackerID = attackerID; attackerID = stream.readUint16(); if (prop.isBase()) { if (inited) { onAttackerIDChanged(oldval_attackerID); } } else { if (inWorld) { onAttackerIDChanged(oldval_attackerID); } } break; case 23: UInt16 oldval_cruiseSpeed = cruiseSpeed; cruiseSpeed = stream.readUint16(); if (prop.isBase()) { if (inited) { onCruiseSpeedChanged(oldval_cruiseSpeed); } } else { if (inWorld) { onCruiseSpeedChanged(oldval_cruiseSpeed); } } break; case 51004: Vector3 oldval_destForward = destForward; destForward = stream.readVector3(); if (prop.isBase()) { if (inited) { onDestForwardChanged(oldval_destForward); } } else { if (inWorld) { onDestForwardChanged(oldval_destForward); } } break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 42006: UInt32 oldval_modelID = modelID; modelID = stream.readUint32(); if (prop.isBase()) { if (inited) { onModelIDChanged(oldval_modelID); } } else { if (inWorld) { onModelIDChanged(oldval_modelID); } } break; case 42007: Byte oldval_modelScale = modelScale; modelScale = stream.readUint8(); if (prop.isBase()) { if (inited) { onModelScaleChanged(oldval_modelScale); } } else { if (inWorld) { onModelScaleChanged(oldval_modelScale); } } break; case 22: UInt16 oldval_moveSpeed = moveSpeed; moveSpeed = stream.readUint16(); if (prop.isBase()) { if (inited) { onMoveSpeedChanged(oldval_moveSpeed); } } else { if (inWorld) { onMoveSpeedChanged(oldval_moveSpeed); } } break; case 42003: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 51002: UInt16 oldval_ownerID = ownerID; ownerID = stream.readUint16(); if (prop.isBase()) { if (inited) { onOwnerIDChanged(oldval_ownerID); } } else { if (inWorld) { onOwnerIDChanged(oldval_ownerID); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 40002: stream.readUint32(); break; case 42008: UInt32 oldval_spaceUType = spaceUType; spaceUType = stream.readUint32(); if (prop.isBase()) { if (inited) { onSpaceUTypeChanged(oldval_spaceUType); } } else { if (inWorld) { onSpaceUTypeChanged(oldval_spaceUType); } } break; case 44006: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; case 42004: UInt32 oldval_uid = uid; uid = stream.readUint32(); if (prop.isBase()) { if (inited) { onUidChanged(oldval_uid); } } else { if (inWorld) { onUidChanged(oldval_uid); } } break; case 42005: UInt32 oldval_utype = utype; utype = stream.readUint32(); if (prop.isBase()) { if (inited) { onUtypeChanged(oldval_utype); } } else { if (inWorld) { onUtypeChanged(oldval_utype); } } break; default: break; } ; } }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Avatar"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 47001: Int32 oldval_HP = HP; HP = stream.readInt32(); if (prop.isBase()) { if (inited) { onHPChanged(oldval_HP); } } else { if (inWorld) { onHPChanged(oldval_HP); } } break; case 47002: Int32 oldval_HP_Max = HP_Max; HP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onHP_MaxChanged(oldval_HP_Max); } } else { if (inWorld) { onHP_MaxChanged(oldval_HP_Max); } } break; case 47003: Int32 oldval_MP = MP; MP = stream.readInt32(); if (prop.isBase()) { if (inited) { onMPChanged(oldval_MP); } } else { if (inWorld) { onMPChanged(oldval_MP); } } break; case 47004: Int32 oldval_MP_Max = MP_Max; MP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onMP_MaxChanged(oldval_MP_Max); } } else { if (inWorld) { onMP_MaxChanged(oldval_MP_Max); } } break; case 17: Int32 oldval_attack_Max = attack_Max; attack_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onAttack_MaxChanged(oldval_attack_Max); } } else { if (inWorld) { onAttack_MaxChanged(oldval_attack_Max); } } break; case 18: Int32 oldval_attack_Min = attack_Min; attack_Min = stream.readInt32(); if (prop.isBase()) { if (inited) { onAttack_MinChanged(oldval_attack_Min); } } else { if (inWorld) { onAttack_MinChanged(oldval_attack_Min); } } break; case 19: Int32 oldval_defence = defence; defence = stream.readInt32(); if (prop.isBase()) { if (inited) { onDefenceChanged(oldval_defence); } } else { if (inWorld) { onDefenceChanged(oldval_defence); } } break; case 25: Int32 oldval_dexterity = dexterity; dexterity = stream.readInt32(); if (prop.isBase()) { if (inited) { onDexterityChanged(oldval_dexterity); } } else { if (inWorld) { onDexterityChanged(oldval_dexterity); } } break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 21: Int32 oldval_dodge = dodge; dodge = stream.readInt32(); if (prop.isBase()) { if (inited) { onDodgeChanged(oldval_dodge); } } else { if (inWorld) { onDodgeChanged(oldval_dodge); } } break; case 7: ITEM_INFO_LIST oldval_equipItemList = equipItemList; equipItemList = ((DATATYPE_ITEM_INFO_LIST)EntityDef.id2datatypes[28]).createFromStreamEx(stream); if (prop.isBase()) { if (inited) { onEquipItemListChanged(oldval_equipItemList); } } else { if (inWorld) { onEquipItemListChanged(oldval_equipItemList); } } break; case 8: Int32 oldval_equipWeapon = equipWeapon; equipWeapon = stream.readInt32(); if (prop.isBase()) { if (inited) { onEquipWeaponChanged(oldval_equipWeapon); } } else { if (inWorld) { onEquipWeaponChanged(oldval_equipWeapon); } } break; case 23: UInt64 oldval_exp = exp; exp = stream.readUint64(); if (prop.isBase()) { if (inited) { onExpChanged(oldval_exp); } } else { if (inWorld) { onExpChanged(oldval_exp); } } break; case 47005: Int32 oldval_forbids = forbids; forbids = stream.readInt32(); if (prop.isBase()) { if (inited) { onForbidsChanged(oldval_forbids); } } else { if (inWorld) { onForbidsChanged(oldval_forbids); } } break; case 6: ITEM_INFO_LIST oldval_itemList = itemList; itemList = ((DATATYPE_ITEM_INFO_LIST)EntityDef.id2datatypes[28]).createFromStreamEx(stream); if (prop.isBase()) { if (inited) { onItemListChanged(oldval_itemList); } } else { if (inWorld) { onItemListChanged(oldval_itemList); } } break; case 5: UInt16 oldval_level = level; level = stream.readUint16(); if (prop.isBase()) { if (inited) { onLevelChanged(oldval_level); } } else { if (inWorld) { onLevelChanged(oldval_level); } } break; case 41006: UInt32 oldval_modelID = modelID; modelID = stream.readUint32(); if (prop.isBase()) { if (inited) { onModelIDChanged(oldval_modelID); } } else { if (inWorld) { onModelIDChanged(oldval_modelID); } } break; case 41007: Byte oldval_modelScale = modelScale; modelScale = stream.readUint8(); if (prop.isBase()) { if (inited) { onModelScaleChanged(oldval_modelScale); } } else { if (inWorld) { onModelScaleChanged(oldval_modelScale); } } break; case 22: UInt64 oldval_money = money; money = stream.readUint64(); if (prop.isBase()) { if (inited) { onMoneyChanged(oldval_money); } } else { if (inWorld) { onMoneyChanged(oldval_money); } } break; case 12: Byte oldval_moveSpeed = moveSpeed; moveSpeed = stream.readUint8(); if (prop.isBase()) { if (inited) { onMoveSpeedChanged(oldval_moveSpeed); } } else { if (inWorld) { onMoveSpeedChanged(oldval_moveSpeed); } } break; case 41003: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 20: Int32 oldval_rating = rating; rating = stream.readInt32(); if (prop.isBase()) { if (inited) { onRatingChanged(oldval_rating); } } else { if (inWorld) { onRatingChanged(oldval_rating); } } break; case 4: Byte oldval_roleTypeCell = roleTypeCell; roleTypeCell = stream.readUint8(); if (prop.isBase()) { if (inited) { onRoleTypeCellChanged(oldval_roleTypeCell); } } else { if (inWorld) { onRoleTypeCellChanged(oldval_roleTypeCell); } } break; case 40002: stream.readUint32(); break; case 41001: UInt32 oldval_spaceUType = spaceUType; spaceUType = stream.readUint32(); if (prop.isBase()) { if (inited) { onSpaceUTypeChanged(oldval_spaceUType); } } else { if (inWorld) { onSpaceUTypeChanged(oldval_spaceUType); } } break; case 26: Int32 oldval_stamina = stamina; stamina = stream.readInt32(); if (prop.isBase()) { if (inited) { onStaminaChanged(oldval_stamina); } } else { if (inWorld) { onStaminaChanged(oldval_stamina); } } break; case 47006: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; case 24: Int32 oldval_strength = strength; strength = stream.readInt32(); if (prop.isBase()) { if (inited) { onStrengthChanged(oldval_strength); } } else { if (inWorld) { onStrengthChanged(oldval_strength); } } break; case 47007: Byte oldval_subState = subState; subState = stream.readUint8(); if (prop.isBase()) { if (inited) { onSubStateChanged(oldval_subState); } } else { if (inWorld) { onSubStateChanged(oldval_subState); } } break; case 41004: UInt32 oldval_uid = uid; uid = stream.readUint32(); if (prop.isBase()) { if (inited) { onUidChanged(oldval_uid); } } else { if (inWorld) { onUidChanged(oldval_uid); } } break; case 41005: UInt32 oldval_utype = utype; utype = stream.readUint32(); if (prop.isBase()) { if (inited) { onUtypeChanged(oldval_utype); } } else { if (inWorld) { onUtypeChanged(oldval_utype); } } break; default: break; } ; } }
public void Client_onUpdateData_r(MemoryStream stream) { Int32 eid = stream.readInt32(); SByte r = stream.readInt8(); _updateVolatileData(eid, 0.0f, 0.0f, 0.0f, KBE_FLT_MAX, KBE_FLT_MAX, r); }
public void onImportClientMessages(MemoryStream stream) { UInt16 msgcount = stream.readUint16(); Dbg.DEBUG_MSG(string.Format("KBEngine::Client_onImportClientMessages: start currserver=" + currserver + "(msgsize={0})...", msgcount)); while(msgcount > 0) { msgcount--; MessageID msgid = stream.readUint16(); Int16 msglen = stream.readInt16(); string msgname = stream.readString(); sbyte argstype = stream.readInt8(); Byte argsize = stream.readUint8(); List<Byte> argstypes = new List<Byte>(); for(Byte i=0; i<argsize; i++) { argstypes.Add(stream.readUint8()); } System.Reflection.MethodInfo handler = null; bool isClientMethod = msgname.Contains("Client_"); if(isClientMethod) { handler = typeof(KBEngineApp).GetMethod(msgname); if(handler == null) { Dbg.WARNING_MSG(string.Format("KBEngine::onImportClientMessages[{0}]: interface({1}/{2}/{3}) no implement!", currserver, msgname, msgid, msglen)); handler = null; } else { //Dbg.DEBUG_MSG(string.Format("KBEngine::onImportClientMessages: imported({0}/{1}/{2}) successfully!", // msgname, msgid, msglen)); } } if(msgname.Length > 0) { Message.messages[msgname] = new Message(msgid, msgname, msglen, argstype, argstypes, handler); //if(!isClientMethod) // Dbg.DEBUG_MSG(string.Format("KBEngine::onImportClientMessages[{0}]: imported({1}/{2}/{3}) successfully!", // currserver, msgname, msgid, msglen)); if(isClientMethod) { Message.clientMessages[msgid] = Message.messages[msgname]; } else { if(currserver == "loginapp") Message.loginappMessages[msgid] = Message.messages[msgname]; else Message.baseappMessages[msgid] = Message.messages[msgname]; } } else { Message msg = new Message(msgid, msgname, msglen, argstype, argstypes, handler); //if(!isClientMethod) // Dbg.DEBUG_MSG(string.Format("KBEngine::onImportClientMessages[{0}]: imported({1}/{2}/{3}) successfully!", // currserver, msgname, msgid, msglen)); if(currserver == "loginapp") Message.loginappMessages[msgid] = msg; else Message.baseappMessages[msgid] = msg; } }; onImportClientMessagesCompleted(); }
public void Client_onUpdateData_xz_yp(MemoryStream stream) { Int32 eid = stream.readInt32(); Vector2 xz = stream.readPackXZ(); SByte y = stream.readInt8(); SByte p = stream.readInt8(); _updateVolatileData(eid, xz[0], 0.0f, xz[1], y, p, KBE_FLT_MAX); }
/* 服务端通知一个实体进入了世界(如果实体是当前玩家则玩家第一次在一个space中创建了, 如果是其他实体则是其他实体进入了玩家的AOI) */ public void Client_onEntityEnterWorld(MemoryStream stream) { Int32 eid = stream.readInt32(); if(entity_id > 0 && entity_id != eid) _entityIDAliasIDList.Add(eid); UInt16 uentityType; if(EntityDef.idmoduledefs.Count > 255) uentityType = stream.readUint16(); else uentityType = stream.readUint8(); sbyte isOnGround = 1; if(stream.length() > 0) isOnGround = stream.readInt8(); string entityType = EntityDef.idmoduledefs[uentityType].name; // Dbg.DEBUG_MSG("KBEngine::Client_onEntityEnterWorld: " + entityType + "(" + eid + "), spaceID(" + KBEngineApp.app.spaceID + ")!"); Entity entity = null; if(!entities.TryGetValue(eid, out entity)) { MemoryStream entityMessage = null; if(!_bufferedCreateEntityMessage.TryGetValue(eid, out entityMessage)) { Dbg.ERROR_MSG("KBEngine::Client_onEntityEnterWorld: entity(" + eid + ") not found!"); return; } ScriptModule module = null; if(!EntityDef.moduledefs.TryGetValue(entityType, out module)) { Dbg.ERROR_MSG("KBEngine::Client_onEntityEnterWorld: not found module(" + entityType + ")!"); } Type runclass = module.script; if(runclass == null) return; entity = (Entity)Activator.CreateInstance(runclass); entity.id = eid; entity.className = entityType; entity.cellMailbox = new Mailbox(); entity.cellMailbox.id = eid; entity.cellMailbox.className = entityType; entity.cellMailbox.type = Mailbox.MAILBOX_TYPE.MAILBOX_TYPE_CELL; entities[eid] = entity; Client_onUpdatePropertys(entityMessage); _bufferedCreateEntityMessage.Remove(eid); entity.isOnGround = isOnGround > 0; entity.set_direction(entity.getDefinedPropterty("direction")); entity.set_position(entity.getDefinedPropterty("position")); entity.__init__(); entity.enterWorld(); } else { if(!entity.inWorld) { // 安全起见, 这里清空一下 // 如果服务端上使用giveClientTo切换控制权 // 之前的实体已经进入世界, 切换后的实体也进入世界, 这里可能会残留之前那个实体进入世界的信息 _entityIDAliasIDList.Clear(); clearEntities(false); entities[entity.id] = entity; entity.cellMailbox = new Mailbox(); entity.cellMailbox.id = eid; entity.cellMailbox.className = entityType; entity.cellMailbox.type = Mailbox.MAILBOX_TYPE.MAILBOX_TYPE_CELL; entity.set_direction(entity.getDefinedPropterty("direction")); entity.set_position(entity.getDefinedPropterty("position")); _entityServerPos = entity.position; entity.isOnGround = isOnGround > 0; entity.enterWorld(); } } }
public void Client_onUpdateData_xyz_yr(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); Vector2 xz = stream.readPackXZ(); float y = stream.readPackY(); SByte yaw = stream.readInt8(); SByte r = stream.readInt8(); _updateVolatileData(eid, xz[0], y, xz[1], yaw, KBEDATATYPE_BASE.KBE_FLT_MAX, r, 0); }
public override object createFromStream(MemoryStream stream) { return(stream.readInt8()); }
public void Client_onUpdateData_ypr(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); SByte y = stream.readInt8(); SByte p = stream.readInt8(); SByte r = stream.readInt8(); _updateVolatileData(eid, 0.0f, 0.0f, 0.0f, y, p, r, -1); }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Avatar"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (prop.properUtype) { case 48005: UInt32 oldval_Die_Count = Die_Count; Die_Count = stream.readUint32(); if (prop.isBase()) { if (inited) { onDie_CountChanged(oldval_Die_Count); } } else { if (inWorld) { onDie_CountChanged(oldval_Die_Count); } } break; case 47005: Int32 oldval_EXP = EXP; EXP = stream.readInt32(); if (prop.isBase()) { if (inited) { onEXPChanged(oldval_EXP); } } else { if (inWorld) { onEXPChanged(oldval_EXP); } } break; case 47006: Int32 oldval_EXP_Max = EXP_Max; EXP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onEXP_MaxChanged(oldval_EXP_Max); } } else { if (inWorld) { onEXP_MaxChanged(oldval_EXP_Max); } } break; case 47001: Int32 oldval_HP = HP; HP = stream.readInt32(); if (prop.isBase()) { if (inited) { onHPChanged(oldval_HP); } } else { if (inWorld) { onHPChanged(oldval_HP); } } break; case 47002: Int32 oldval_HP_Max = HP_Max; HP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onHP_MaxChanged(oldval_HP_Max); } } else { if (inWorld) { onHP_MaxChanged(oldval_HP_Max); } } break; case 48006: UInt32 oldval_Kill_Count = Kill_Count; Kill_Count = stream.readUint32(); if (prop.isBase()) { if (inited) { onKill_CountChanged(oldval_Kill_Count); } } else { if (inWorld) { onKill_CountChanged(oldval_Kill_Count); } } break; case 47003: Int32 oldval_MP = MP; MP = stream.readInt32(); if (prop.isBase()) { if (inited) { onMPChanged(oldval_MP); } } else { if (inWorld) { onMPChanged(oldval_MP); } } break; case 47004: Int32 oldval_MP_Max = MP_Max; MP_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onMP_MaxChanged(oldval_MP_Max); } } else { if (inWorld) { onMP_MaxChanged(oldval_MP_Max); } } break; case 48003: UInt32 oldval_Rank = Rank; Rank = stream.readUint32(); if (prop.isBase()) { if (inited) { onRankChanged(oldval_Rank); } } else { if (inWorld) { onRankChanged(oldval_Rank); } } break; case 48001: Int32 oldval_Round = Round; Round = stream.readInt32(); if (prop.isBase()) { if (inited) { onRoundChanged(oldval_Round); } } else { if (inWorld) { onRoundChanged(oldval_Round); } } break; case 48002: Int32 oldval_Round_Max = Round_Max; Round_Max = stream.readInt32(); if (prop.isBase()) { if (inited) { onRound_MaxChanged(oldval_Round_Max); } } else { if (inWorld) { onRound_MaxChanged(oldval_Round_Max); } } break; case 48004: UInt32 oldval_Score = Score; Score = stream.readUint32(); if (prop.isBase()) { if (inited) { onScoreChanged(oldval_Score); } } else { if (inWorld) { onScoreChanged(oldval_Score); } } break; case 12: UInt16 oldval_cruiseSpeed = cruiseSpeed; cruiseSpeed = stream.readUint16(); if (prop.isBase()) { if (inited) { onCruiseSpeedChanged(oldval_cruiseSpeed); } } else { if (inWorld) { onCruiseSpeedChanged(oldval_cruiseSpeed); } } break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 41002: UInt16 oldval_level = level; level = stream.readUint16(); if (prop.isBase()) { if (inited) { onLevelChanged(oldval_level); } } else { if (inWorld) { onLevelChanged(oldval_level); } } break; case 42006: UInt32 oldval_modelID = modelID; modelID = stream.readUint32(); if (prop.isBase()) { if (inited) { onModelIDChanged(oldval_modelID); } } else { if (inWorld) { onModelIDChanged(oldval_modelID); } } break; case 42007: Byte oldval_modelScale = modelScale; modelScale = stream.readUint8(); if (prop.isBase()) { if (inited) { onModelScaleChanged(oldval_modelScale); } } else { if (inWorld) { onModelScaleChanged(oldval_modelScale); } } break; case 11: UInt16 oldval_moveSpeed = moveSpeed; moveSpeed = stream.readUint16(); if (prop.isBase()) { if (inited) { onMoveSpeedChanged(oldval_moveSpeed); } } else { if (inWorld) { onMoveSpeedChanged(oldval_moveSpeed); } } break; case 42003: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 40002: stream.readUint32(); break; case 42008: UInt32 oldval_spaceUType = spaceUType; spaceUType = stream.readUint32(); if (prop.isBase()) { if (inited) { onSpaceUTypeChanged(oldval_spaceUType); } } else { if (inWorld) { onSpaceUTypeChanged(oldval_spaceUType); } } break; case 44006: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; case 42004: UInt32 oldval_uid = uid; uid = stream.readUint32(); if (prop.isBase()) { if (inited) { onUidChanged(oldval_uid); } } else { if (inWorld) { onUidChanged(oldval_uid); } } break; case 42005: UInt32 oldval_utype = utype; utype = stream.readUint32(); if (prop.isBase()) { if (inited) { onUtypeChanged(oldval_utype); } } else { if (inWorld) { onUtypeChanged(oldval_utype); } } break; default: break; } ; } }
/* 服务端通知当前玩家进入了一个新的space */ public void Client_onEntityEnterSpace(MemoryStream stream) { Int32 eid = stream.readInt32(); spaceID = stream.readUint32(); sbyte isOnGround = 1; if(stream.length() > 0) isOnGround = stream.readInt8(); Entity entity = null; if(!entities.TryGetValue(eid, out entity)) { Dbg.ERROR_MSG("KBEngine::Client_onEntityEnterSpace: entity(" + eid + ") not found!"); return; } entity.isOnGround = isOnGround > 0; _entityServerPos = entity.position; entity.enterSpace(); }
public override void onRemoteMethodCall(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Account"]; UInt16 methodUtype = 0; UInt16 componentPropertyUType = 0; if (sm.useMethodDescrAlias) { componentPropertyUType = stream.readUint8(); methodUtype = stream.readUint8(); } else { componentPropertyUType = stream.readUint16(); methodUtype = stream.readUint16(); } Method method = null; if (componentPropertyUType == 0) { method = sm.idmethods[methodUtype]; } else { Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (method.methodUtype) { case 20: Byte OnReqCreateAvatar_arg1 = stream.readUint8(); OnReqCreateAvatar(OnReqCreateAvatar_arg1); break; case 23: game_begin_push(); break; case 26: game_chupai_push(); break; case 28: SByte game_mopai_push_arg1 = stream.readInt8(); game_mopai_push(game_mopai_push_arg1); break; case 34: TING_PAI_LIST hasTing_arg1 = ((DATATYPE_TING_PAI_LIST)method.args[0]).createFromStreamEx(stream); hasTing(hasTing_arg1); break; case 25: has_action(); break; case 31: UInt32 onGang_arg1 = stream.readUint32(); SByte onGang_arg2 = stream.readInt8(); string onGang_arg3 = stream.readUnicode(); onGang(onGang_arg1, onGang_arg2, onGang_arg3); break; case 22: ROOM_PUBLIC_INFO onGetRoomInfo_arg1 = ((DATATYPE_ROOM_PUBLIC_INFO)method.args[0]).createFromStreamEx(stream); onGetRoomInfo(onGetRoomInfo_arg1); break; case 32: UInt32 onHu_arg1 = stream.readUint32(); Byte onHu_arg2 = stream.readUint8(); SByte onHu_arg3 = stream.readInt8(); onHu(onHu_arg1, onHu_arg2, onHu_arg3); break; case 27: UInt32 onPlayCard_arg1 = stream.readUint32(); SByte onPlayCard_arg2 = stream.readInt8(); onPlayCard(onPlayCard_arg1, onPlayCard_arg2); break; case 33: UInt32 onPlayCardOver_arg1 = stream.readUint32(); SByte onPlayCardOver_arg2 = stream.readInt8(); onPlayCardOver(onPlayCardOver_arg1, onPlayCardOver_arg2); break; case 29: UInt32 otherPlayerMopai_arg1 = stream.readUint32(); otherPlayerMopai(otherPlayerMopai_arg1); break; case 30: UInt32 peng_notify_push_arg1 = stream.readUint32(); SByte peng_notify_push_arg2 = stream.readInt8(); peng_notify_push(peng_notify_push_arg1, peng_notify_push_arg2); break; case 21: playerLevelRoom(); break; case 24: ROOM_PUBLIC_INFO upDataClientRoomInfo_arg1 = ((DATATYPE_ROOM_PUBLIC_INFO)method.args[0]).createFromStreamEx(stream); upDataClientRoomInfo(upDataClientRoomInfo_arg1); break; default: break; } ; }
public void Client_onUpdateData_r(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); SByte r = stream.readInt8(); _updateVolatileData(eid, 0.0f, 0.0f, 0.0f, KBEDATATYPE_BASE.KBE_FLT_MAX, KBEDATATYPE_BASE.KBE_FLT_MAX, r, -1); }
public override void onRemoteMethodCall(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Account"]; UInt16 methodUtype = 0; UInt16 componentPropertyUType = 0; if (sm.usePropertyDescrAlias) { componentPropertyUType = stream.readUint8(); } else { componentPropertyUType = stream.readUint16(); } if (sm.useMethodDescrAlias) { methodUtype = stream.readUint8(); } else { methodUtype = stream.readUint16(); } Method method = null; if (componentPropertyUType == 0) { method = sm.idmethods[methodUtype]; } else { Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType]; switch (pComponentPropertyDescription.properUtype) { default: break; } return; } switch (method.methodUtype) { case 33: POKERLIST displayPoker_arg1 = ((DATATYPE_POKERLIST)method.args[0]).createFromStreamEx(stream); displayPoker(displayPoker_arg1); break; case 37: FRIENDDATALIST friendListData_arg1 = ((DATATYPE_FRIENDDATALIST)method.args[0]).createFromStreamEx(stream); friendListData(friendListData_arg1); break; case 26: initGamePoker(); break; case 31: SByte loadLandlordPoker_arg1 = stream.readInt8(); POKERLIST loadLandlordPoker_arg2 = ((DATATYPE_POKERLIST)method.args[1]).createFromStreamEx(stream); loadLandlordPoker(loadLandlordPoker_arg1, loadLandlordPoker_arg2); break; case 27: notifyToCallLandlord(); break; case 28: SByte notifyToPlayPoker_arg1 = stream.readInt8(); notifyToPlayPoker(notifyToPlayPoker_arg1); break; case 34: passPoker(); break; case 32: playPokerFailed(); break; case 29: SByte playerReadyGame_arg1 = stream.readInt8(); SByte playerReadyGame_arg2 = stream.readInt8(); playerReadyGame(playerReadyGame_arg1, playerReadyGame_arg2); break; case 30: SByte playerToLandlord_arg1 = stream.readInt8(); SByte playerToLandlord_arg2 = stream.readInt8(); playerToLandlord(playerToLandlord_arg1, playerToLandlord_arg2); break; case 35: Int32 pokerGameOver_arg1 = stream.readInt32(); pokerGameOver(pokerGameOver_arg1); break; case 36: MAILDATA receiveMail_arg1 = ((DATATYPE_MAILDATA)method.args[0]).createFromStreamEx(stream); receiveMail(receiveMail_arg1); break; case 25: SByte returnErrorMessage_arg1 = stream.readInt8(); returnErrorMessage(returnErrorMessage_arg1); break; case 38: Int32 stayInRoom_arg1 = stream.readInt32(); stayInRoom(stayInRoom_arg1); break; default: break; } ; }
public void Client_onUpdateData_xz_yp(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); Vector2 xz = stream.readPackXZ(); SByte y = stream.readInt8(); SByte p = stream.readInt8(); _updateVolatileData(eid, xz[0], 0.0f, xz[1], y, p, KBEDATATYPE_BASE.KBE_FLT_MAX, 1); }
public void Client_onUpdateData_xz_y(MemoryStream stream) { Int32 eid = getAoiEntityIDFromStream(stream); Vector2 xz = stream.readPackXZ(); SByte yaw = stream.readInt8(); _updateVolatileData(eid, xz[0], 0.0f, xz[1], yaw, KBE_FLT_MAX, KBE_FLT_MAX); }
public void Client_onEntityEnterWorld(MemoryStream stream) { Int32 eid = stream.readInt32(); if(entity_id > 0 && entity_id != eid) entityIDAliasIDList.Add(eid); UInt16 uentityType; if(EntityDef.idmoduledefs.Count > 255) uentityType = stream.readUint16(); else uentityType = stream.readUint8(); sbyte isOnGound = 1; if(stream.opsize() > 0) isOnGound = stream.readInt8(); string entityType = EntityDef.idmoduledefs[uentityType].name; Dbg.DEBUG_MSG("KBEngine::Client_onEntityEnterWorld: " + entityType + "(" + eid + "), spaceID(" + KBEngineApp.app.spaceID + ")!"); Entity entity = null; if(!entities.TryGetValue(eid, out entity)) { MemoryStream entityMessage = null; if(!bufferedCreateEntityMessage.TryGetValue(eid, out entityMessage)) { Dbg.ERROR_MSG("KBEngine::Client_onEntityEnterWorld: entity(" + eid + ") not found!"); return; } Type runclass = EntityDef.moduledefs[entityType].script; if(runclass == null) return; entity = (Entity)Activator.CreateInstance(runclass); entity.id = eid; entity.classtype = entityType; entity.cellMailbox = new Mailbox(); entity.cellMailbox.id = eid; entity.cellMailbox.classtype = entityType; entity.cellMailbox.type = Mailbox.MAILBOX_TYPE.MAILBOX_TYPE_CELL; entities[eid] = entity; Client_onUpdatePropertys(entityMessage); bufferedCreateEntityMessage.Remove(eid); entity.isOnGound = isOnGound > 0; entity.__init__(); entity.onEnterWorld(); Event.fireOut("set_direction", new object[]{entity}); Event.fireOut("set_position", new object[]{entity}); } else { if(!entity.inWorld) { entity.cellMailbox = new Mailbox(); entity.cellMailbox.id = eid; entity.cellMailbox.classtype = entityType; entity.cellMailbox.type = Mailbox.MAILBOX_TYPE.MAILBOX_TYPE_CELL; entityServerPos = entity.position; entity.isOnGound = isOnGound > 0; entity.onEnterWorld(); } } }
public override void onUpdatePropertys(MemoryStream stream) { ScriptModule sm = EntityDef.moduledefs["Avatar"]; Dictionary <UInt16, Property> pdatas = sm.idpropertys; while (stream.length() > 0) { UInt16 _t_utype = 0; UInt16 _t_child_utype = 0; { if (sm.usePropertyDescrAlias) { _t_utype = stream.readUint8(); _t_child_utype = stream.readUint8(); } else { _t_utype = stream.readUint16(); _t_child_utype = stream.readUint16(); } } Property prop = null; if (_t_utype == 0) { prop = pdatas[_t_child_utype]; } else { Property pComponentPropertyDescription = pdatas[_t_utype]; switch (pComponentPropertyDescription.properUtype) { case 15: componentFrameSync.onUpdatePropertys(_t_child_utype, stream, -1); break; default: break; } return; } switch (prop.properUtype) { case 15: componentFrameSync.createFromStream(stream); break; case 40001: Vector3 oldval_direction = direction; direction = stream.readVector3(); if (prop.isBase()) { if (inited) { onDirectionChanged(oldval_direction); } } else { if (inWorld) { onDirectionChanged(oldval_direction); } } break; case 11: SByte oldval_gameStateC = gameStateC; gameStateC = stream.readInt8(); if (prop.isBase()) { if (inited) { onGameStateCChanged(oldval_gameStateC); } } else { if (inWorld) { onGameStateCChanged(oldval_gameStateC); } } break; case 13: Byte oldval_modelID = modelID; modelID = stream.readUint8(); if (prop.isBase()) { if (inited) { onModelIDChanged(oldval_modelID); } } else { if (inWorld) { onModelIDChanged(oldval_modelID); } } break; case 8: float oldval_moveSpeed = moveSpeed; moveSpeed = stream.readFloat(); if (prop.isBase()) { if (inited) { onMoveSpeedChanged(oldval_moveSpeed); } } else { if (inWorld) { onMoveSpeedChanged(oldval_moveSpeed); } } break; case 3: string oldval_name = name; name = stream.readUnicode(); if (prop.isBase()) { if (inited) { onNameChanged(oldval_name); } } else { if (inWorld) { onNameChanged(oldval_name); } } break; case 40000: Vector3 oldval_position = position; position = stream.readVector3(); if (prop.isBase()) { if (inited) { onPositionChanged(oldval_position); } } else { if (inWorld) { onPositionChanged(oldval_position); } } break; case 4: Byte oldval_roleType = roleType; roleType = stream.readUint8(); if (prop.isBase()) { if (inited) { onRoleTypeChanged(oldval_roleType); } } else { if (inWorld) { onRoleTypeChanged(oldval_roleType); } } break; case 40002: stream.readUint32(); break; case 9: SByte oldval_state = state; state = stream.readInt8(); if (prop.isBase()) { if (inited) { onStateChanged(oldval_state); } } else { if (inWorld) { onStateChanged(oldval_state); } } break; case 6: Byte oldval_teamID = teamID; teamID = stream.readUint8(); if (prop.isBase()) { if (inited) { onTeamIDChanged(oldval_teamID); } } else { if (inWorld) { onTeamIDChanged(oldval_teamID); } } break; case 5: Int32 oldval_weaponID = weaponID; weaponID = stream.readInt32(); if (prop.isBase()) { if (inited) { onWeaponIDChanged(oldval_weaponID); } } else { if (inWorld) { onWeaponIDChanged(oldval_weaponID); } } break; default: break; } ; } }