示例#1
0
        private void onNewCharacterEvent(Dictionary <byte, object> parameters)
        {
            if (Settings.PlaySoundOnPlayer())
            {
                new Thread(() => Console.Beep(1000, 1000)).Start();
            }


            int    id     = int.Parse(parameters[0].ToString());
            string nick   = parameters[1].ToString();
            object oGuild = "";

            parameters.TryGetValue((byte)8, out oGuild);
            string guild = oGuild == null ? "" : oGuild.ToString();

            //string guild = parameters[8].ToString() || null;
            string alliance = parameters[44].ToString();

            Single[] a13 = (Single[])parameters[13]; //pos1

            playerHandler.AddPlayer(a13[0], a13[1], nick, guild, alliance, id);
        }
示例#2
0
        private void onNewCharacterEvent(Dictionary <byte, object> parameters)
        {
            int    id        = int.Parse(parameters[0].ToString());
            string nick      = parameters[1].ToString();
            object oGuild    = "";
            object oAlliance = "";

            parameters.TryGetValue((byte)8, out oGuild);
            parameters.TryGetValue((byte)43, out oAlliance);
            string guild    = oGuild == null ? "" : oGuild.ToString();
            string alliance = oGuild == null ? "" : oAlliance.ToString();

            //string guild = parameters[8].ToString() || null;
            //string alliance = parameters[43].ToString();

            Single[] a13 = (Single[])parameters[13]; //pos1


            string json = JsonConvert.SerializeObject(parameters.ToArray());

            using (System.IO.StreamWriter sw = System.IO.File.AppendText("players.json"))
            {
                sw.WriteLine(json);
            }
            Debug.WriteLine(json);

            if (Settings.PlaySoundOnPlayer())
            {
                if (!Settings.IsInAlliance(alliance))
                {
                    new Thread(() => Console.Beep(1000, 1000)).Start();
                }
            }

            playerHandler.AddPlayer(a13[0], a13[1], nick, guild, alliance, id);
        }