public GetGamePackKeyEx ( ) : |
||
Результат |
//广播 public virtual void BrocatBuffer(byte[] msg) { foreach (RefreshObject refobj in this.GetVisibleList().Values) { BaseObject obj = refobj.obj; if (obj.type == OBJECTTYPE.PLAYER && obj.GetGameSession() != null) { BaseMsg data = new BaseMsg(); data.Create(msg, obj.GetGamePackKeyEx()); obj.SendData(data.GetBuffer()); } } }
//广播移动消息 //public void BroadcastMove(BaseObject obj,byte[] data) //{ // foreach (BaseObject o in obj.mVisibleList.Values) // { // if (o.type == OBJECTTYPE.PLAYER) // { // PlayerObject po = o as PlayerObject; // o.SendData(data); // } // } //} //广播消息 public void BroadcastBuffer(BaseObject obj, byte[] buff) { // obj.RefreshVisibleObject(); foreach (RefreshObject o in obj.GetVisibleList().Values) { BaseObject _obj = o.obj; if (_obj.type == OBJECTTYPE.PLAYER && _obj.GetGameSession() != null) { NetMsg.BaseMsg basemsg = new NetMsg.BaseMsg(); basemsg.Create(buff, _obj.GetGamePackKeyEx()); _obj.SendData(basemsg.GetBuffer()); } } }
public void SendMoveInfo(BaseObject obj, byte runValue) { //if (obj.type != OBJECTTYPE.PLAYER) return; //PlayerObject play = obj as PlayerObject; //if (obj.GetGameSession() == null) return; //已经断线 //if (!play.GetPlayObjectList().ContainsKey(this.GetGameID()) || // !this.GetPlayObjectList().ContainsKey(play.GetGameID())) //{ // this.SendPlayRefreshInfo(play); // play.GetPlayObjectList()[this.GetGameID()] = this; // this.GetPlayObjectList()[play.GetGameID()] = play; // // Log.Instance().WriteLog("发送刷新幻兽信息!!"); // return; //} //存在可视列表就发移动消息 NetMsg.MsgMoveInfo move = new NetMsg.MsgMoveInfo(); move.Create(null, obj.GetGamePackKeyEx()); move.id = this.GetTypeId(); move.x = this.GetCurrentX(); move.y = this.GetCurrentY(); move.dir = this.GetDir(); move.ucMode = runValue; obj.SendData(move.GetBuffer()); }