コード例 #1
0
ファイル: ObjectManager.cs プロジェクト: bmjoy/IOCPGameServer
    private void MonsterSet(InputMemoryStream inInputStream, short Count)
    {
        lock (lockObject)
        {
            for (int i = 0; i < Count; i++)
            {
                int     _id  = 0;
                Vector3 _pos = new Vector3();
                Vector3 _dir = new Vector3();
                float   _hp  = 0;
                inInputStream.Read(ref _id);
                inInputStream.Read(ref _pos);
                inInputStream.Read(ref _dir);
                inInputStream.Read(ref _hp);
                MonsterManager.instance.SearchMonster(_id, _pos, _dir, _hp);
            }

            if (!FistCreateComplete)
            {
                OutputMemoryStream os = new OutputMemoryStream();
                os.Write((short)Defines.SET_COMPLETE);
                NetWork.instance.Send(os);
                FistCreateComplete = true;
            }
        }
    }
コード例 #2
0
ファイル: ObjectManager.cs プロジェクト: bmjoy/IOCPGameServer
 private void PlayerSet(InputMemoryStream inInputStream, short Count)
 {
     lock (lockObject)
     {
         for (int i = 0; i < Count; ++i)
         {
             string name = "";
             inInputStream.Read(ref name);
             short state = 0;
             inInputStream.Read(ref state);
             if (state == Defines.USER_OUT)
             {
                 PlayerManager.instance.DelteUser(name);
             }
             else
             {
                 Vector3 _pos = Vector3.zero;
                 inInputStream.Read(ref _pos);
                 Vector3 _dir = Vector3.zero;
                 inInputStream.Read(ref _dir);
                 PlayerManager.instance.SearchPlayer(name, _pos, _dir, state);
             }
         }
     }
 }
コード例 #3
0
ファイル: ObjectManager.cs プロジェクト: bmjoy/IOCPGameServer
    public void SetObject(InputMemoryStream inInputStream)
    {
        short Count = 0;

        inInputStream.Read(ref Count);
        if (Count != 0)
        {
            PlayerSet(inInputStream, Count);
        }
        inInputStream.Read(ref Count);
        MonsterSet(inInputStream, Count);
    }
コード例 #4
0
    void CheckData(InputMemoryStream inInputStream, int size)
    {
        short type = 0;

        inInputStream.Read(ref type);

        switch (type)
        {
        case 7501:
            bool result = false;
            inInputStream.Read(ref result);
            Debug.Log("LogIn : " + result);
            break;

        case 1500:
            ObjectManager.instance.SetObject(inInputStream);
            break;
        }
    }