示例#1
0
 public static PayManager Instance()
 {
     if (mInstance == null)
        {
        mInstance = new PayManager();
        }
        return mInstance;
 }
示例#2
0
 public static PayManager Instance()
 {
     if (mInstance == null)
     {
         mInstance = new PayManager();
     }
     return(mInstance);
 }
示例#3
0
 private static void LoadGameKernel()
 {
     //载入爵位数据
     GuanJue.GetInstance().DB_Load();
     //载入军团数据
     Legion.GetInstance().DB_Load();
     //载入充值信息
     PayManager.Instance().DB_Load();
 }
示例#4
0
        private static void LogicRun()
        {
            int processtime      = 4;
            int sleeptime        = 4;
            int nlastProcessTime = System.Environment.TickCount;

            while (true)
            {
                if (System.Environment.TickCount - nlastProcessTime > processtime)
                {
                    SessionManager.Instance().Run();
                    //充值信息读取
                    PayManager.Instance().Run();
                    nlastProcessTime = System.Environment.TickCount;
                }

                System.Threading.Thread.Sleep(sleeptime);
            }
        }
示例#5
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;
            }
            }
        }
示例#6
0
 private void ProcessUpdatePayrecInfo(byte[] data)
 {
     GameBase.Network.Internal.PackUpdatePayRecInfo option = new GameBase.Network.Internal.PackUpdatePayRecInfo();
     option.Create(data);
     PayManager.Instance().SetPayTag(option.account);
 }