Beispiel #1
0
 // Join response is received on map switch. Contains local player information.
 private void onJoinResponse(Dictionary <byte, object> parameters)
 {
     try
     {
         PlayerJoinEventArgs e = new PlayerJoinEventArgs();
         e.playerName   = parameters[2].ToString();
         e.guild        = parameters[51].ToString();
         e.alliance     = parameters[69].ToString();
         e.mapID        = parameters[8].ToString();
         e.homeLocation = parameters[59].ToString();
         PacketHandlerEvents.InvokePlayerJoinEvent(e);
     }
     catch
     {
         Console.WriteLine("Error Handling Join Event. Check Event Codes.");
     }
 }
Beispiel #2
0
        private static void onJoinEvent(object sender, PlayerJoinEventArgs e)
        {
            currentMapID = e.mapID;

            ClientLocation c = new ClientLocation();

            c.clientID = Settings.clientID;
            c.location = currentMapID;

            string url = Settings.ROA_MAPPER_API + "client/location";

            var client = new WebClient();

            client.Headers[HttpRequestHeader.ContentType] = "application/json";
            Uri uri          = new Uri(url);
            var servicePoint = ServicePointManager.FindServicePoint(uri);

            servicePoint.Expect100Continue = false;

            client.UploadStringAsync(uri, Newtonsoft.Json.JsonConvert.SerializeObject(c));
        }
 public static void InvokePlayerJoinEvent(PlayerJoinEventArgs e)
 {
     PlayerJoinEvent?.Invoke(null, e);
 }
Beispiel #4
0
 private void onPlayerJoinEvent(object sender, PlayerJoinEventArgs e)
 {
     lblCurrentZone.Text = WorldMap.GetMapDisplayName(e.mapID);
 }