GetGameSession() public method

public GetGameSession ( ) : GameSession
return GameBase.Network.GameSession
コード例 #1
0
 //广播
 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());
         }
     }
 }
コード例 #2
0
ファイル: GameMap.cs プロジェクト: tangfengray/soul
        //广播移动消息
        //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());
                }
            }
        }