Exemplo n.º 1
0
        public void OnCharCreateResult(uint charID, SM_CHAR_CREATE_RESULT.Results Result)
        {
            if (Result == SM_CHAR_CREATE_RESULT.Results.OK)
            {
                createdPC.CharID = charID;
                Common.Quests.Quest q = new Common.Quests.Quest()
                {
                    QuestID  = 250,
                    Step     = 1,
                    NextStep = 1
                };
                createdPC.Quests[q.QuestID] = q;
                CharacterSession.Instance.CharacterSave(createdPC);

                SM_CHAR_CREATE p = new SM_CHAR_CREATE()
                {
                    Character = createdPC
                };
                Network.SendPacket(p);
                chars[createdPC.SlotID] = createdPC;
            }
            else
            {
                SM_CHAR_CREATE_FAILED p1 = new SM_CHAR_CREATE_FAILED()
                {
                    SlotID = Utils.slot2GuidBytes(createdPC.SlotID),
                    Reason = SM_CHAR_CREATE_FAILED.Reasons.NameAlreadyExists
                };
                Network.SendPacket(p1);
            }
        }
Exemplo n.º 2
0
        public void OnCharCreateResult(uint charID, SM_CHAR_CREATE_RESULT.Results Result)
        {
            if (Result == SM_CHAR_CREATE_RESULT.Results.OK)
            {
                createdPC.CharID = charID;
                Common.Quests.Quest q = new Common.Quests.Quest()
                {
                    QuestID  = 250,
                    Step     = 1,
                    NextStep = 1
                };
                createdPC.Quests[q.QuestID] = q;
                CharacterSession.Instance.CharacterSave(createdPC);
                BNSLoginPacket p = new BNSLoginPacket()
                {
                    Command = "STS/1.0 200 OK",
                    Serial  = characterSerial,
                    Content = string.Format("<bns>\n<protocol>Game.bns.{1}</protocol>\n<command>CreatePc</command>\n<result>OK</result>\n<slotid>{0}</slotid>\n</bns>\n",
                                            ((uint)createdPC.SlotID).ToGUID(), createdPC.WorldID)
                };
                p.WritePacket();
                Network.SendPacket(p);
                if (!chars.ContainsKey(createdPC.SlotID))
                {
                    chars[createdPC.SlotID] = createdPC;
                }
            }
            else
            {
                BNSLoginPacket p = new BNSLoginPacket()
                {
                    Command = "STS/1.0 200 OK",
                    Serial  = characterSerial,
                    Content = string.Format("<bns>\n<protocol>Game.bns.{1}</protocol>\n<command>CreatePc</command>\n<result>Fail</result>\n<slotid>{0}</slotid>\n<reason>202</reason>\n</bns>\n",
                                            ((uint)createdPC.SlotID).ToGUID(), createdPC.WorldID)
                };
                p.WritePacket();

                Network.SendPacket(p);
            }
        }
Exemplo n.º 3
0
 protected abstract void OnCharCreateResult(T client, uint charID, SM_CHAR_CREATE_RESULT.Results result);
Exemplo n.º 4
0
 protected override void OnCharCreateResult(GameSession client, uint charID, SM_CHAR_CREATE_RESULT.Results result)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 protected override void OnCharCreateResult(LobbySession client, uint charID, SM_CHAR_CREATE_RESULT.Results result)
 {
     client.OnCharCreateResult(charID, result);
 }