Пример #1
0
 public static Legion GetInstance()
 {
     if (mInstance == null)
     {
         mInstance = new Legion();
     }
     return(mInstance);
 }
Пример #2
0
 public static Legion GetInstance()
 {
     if (mInstance == null)
     {
         mInstance = new Legion();
     }
     return mInstance;
 }
Пример #3
0
 private static void LoadGameKernel()
 {
     //载入爵位数据
     GuanJue.GetInstance().DB_Load();
     //载入军团数据
     Legion.GetInstance().DB_Load();
     //载入充值信息
     PayManager.Instance().DB_Load();
 }
Пример #4
0
        public void Run()
        {
            byte[] data = mPacket.GetData();
            if (data == null)
            {
                return;
            }
            PackIn inpack = new PackIn(data);
            ushort param  = inpack.ReadUInt16();

            switch (param)
            {
            case GameBase.Network.Internal.Define.OPENLOGINSERVER:
            case GameBase.Network.Internal.Define.OPENMAPSERVER:
            {
                mType = inpack.ReadByte();
                mName = inpack.ReadString();
                Log.Instance().WriteLog("server connect...type:" + mType.ToString() + " name:" + mName);
                //如果是mapserver 组 就发额外的数据
                if (mType == GameBase.Network.Internal.Define.TYPE_MAPSERVER)
                {
                    //爵位
                    GuanJue.GetInstance().SendData(0);
                    //军团信息
                    Legion.GetInstance().SendData(0);
                    //充值信息
                    PayManager.Instance().SendData(0);
                }
                break;
            }

            case GameBase.Network.Internal.Define.QUERYROLE:
            {
                ProcessQueryRole(data);
                break;
            }

            case GameBase.Network.Internal.Define.ROLEINFO_RET:
            {
                ProcessRoleInfo_Ret(data);
                break;
            }

            case GameBase.Network.Internal.Define.QUERYROLENAME:
            {
                ProcessQueryRoleName(data);
                break;
            }

            case GameBase.Network.Internal.Define.CREATEROLE:
            {
                ProcessCreateRole(data);
                break;
            }

            case GameBase.Network.Internal.Define.SAVEROLEDATA_ATTR:
            {
                ProcessSaveRoleData_Attr(data);
                break;
            }

            case GameBase.Network.Internal.Define.ADDROLEDATA_ITEM:
            {
                ProcessAddRoleData_Item(data);
                break;
            }

            case GameBase.Network.Internal.Define.DELETEROLEDATA_ITEM:
            {
                ProcessDeleteRoleData_Item(data);
                break;
            }

            case GameBase.Network.Internal.Define.SAVEROLEDATA_ITEM:
            {
                ProcessSaveRoleData_Item(data);
                break;
            }

            case GameBase.Network.Internal.Define.SAVEROLEDATA_MAGIC:
            {
                ProcessSaveRoleData_Magic(data);
                break;
            }

            case GameBase.Network.Internal.Define.SAVEROLEDATA_EUDEMON:
            {
                ProcessSaveRoleData_Eudemon(data);
                break;
            }

            case GameBase.Network.Internal.Define.SAVEROLEDATA_FRIEND:
            {
                ProcessSaveRoleData_Friend(data);
                break;
            }

            case GameBase.Network.Internal.Define.UPDATEGUANJUEDATA:
            {
                ProcessUpdateGuanJueData(data);
                break;
            }

            case GameBase.Network.Internal.Define.CREATELEGION:
            {
                ProcessCreateLegion(data);
                break;
            }

            case GameBase.Network.Internal.Define.UPDATELEGION:
            {
                ProcessUpdateLegion(data);
                break;
            }

            case GameBase.Network.Internal.Define.UPDATEPAYRECINFO:
            {
                ProcessUpdatePayrecInfo(data);
                break;
            }
            }
        }
Пример #5
0
 private void ProcessUpdateLegion(byte[] data)
 {
     GameBase.Network.Internal.LegionOption option = new GameBase.Network.Internal.LegionOption();
     option.Create(data);
     Legion.GetInstance().UpdateLegion(option.mInfo);
 }