/* * Method: ChatDialog() * Parameter: atlas, TcpClient, int, int, int, int, int, int * Return: nothing * Description: initializes the chat dialog box with the * parent and target client as arguments */ public ChatDialog(atlas parent, TcpClient tcpClient, int leftBound, int rightBound, int upperBound, int lowerBound, int xPos, int yPos, int pBdyId) { InitializeComponent(); pBodyId = pBdyId; pBodyCount = pBdyId + 1; xClientPos = xPos; yClientPos = yPos; restXPos = xPos; restYPos = yPos; lBound = leftBound; rBound = rightBound; uBound = upperBound; loBound = lowerBound; this.owner = parent; // Get Stream Object connectedClient = tcpClient; clientStream = tcpClient.GetStream(); atlasComm = new AtlasComm(tcpClient); // Create the state object. StateObject state = new StateObject(); state.workSocket = connectedClient.Client; //Call Asynchronous Receive Function connectedClient.Client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(OnReceive), state); connection = new SQLiteConnection("Data Source=C:\\SQLite\\WorldMap.db; Version = 3;"); atlasComm.AssignNewKey(); atlasComm.SendPublicKey(); Thread.Sleep(1000); SendStartingLocation(); }