lots of things

This commit is contained in:
princessbobsanta 2016-04-27 14:52:31 -10:00
parent dade1de9a5
commit 5eb7096411
38 changed files with 568 additions and 494 deletions

View File

@ -50,25 +50,35 @@ namespace GameCreatorGroupProject
bool connected = r.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(5));
if (connected)
{
stream = client.GetStream();
writer = new StreamWriter(stream);
reader = new StreamReader(stream);
//verifies client with server
writer.WriteLine(MainClient.getThisClientID());
writer.WriteLine(serverID);
writer.Flush();
//stops if method called improperly, or timeout reached on connection resulting in connection to be improperly established
if (reader.ReadLine().Equals("err"))
try
{
disconnectClient();
MessageBox.Show("Connection refused by server.", "Connection declined.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
MainClient.available.Enqueue(this);
stream = client.GetStream();
writer = new StreamWriter(stream);
reader = new StreamReader(stream);
//verifies client with server
writer.WriteLine(MainClient.getThisClientID());
writer.WriteLine(serverID);
writer.Flush();
//stops if method called improperly, or timeout reached on connection resulting in connection to be improperly established
if (reader.ReadLine().Equals("err"))
{
disconnectClient();
MessageBox.Show("Connection refused by server.", "Connection declined.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
//resets priority after connected
Thread.CurrentThread.Priority = ThreadPriority.Normal;
//tells server clients username
writer.WriteLine(MainClient.getUsername());
writer.Flush();
}
//resets priority after connected
Thread.CurrentThread.Priority = ThreadPriority.Normal;
//tells server clients username
writer.WriteLine(MainClient.getUsername());
writer.Flush();
catch (IOException)
{
MessageBox.Show("The connection has timed out.", "Connection timeout.", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
@ -101,7 +111,7 @@ namespace GameCreatorGroupProject
catch (Exception) { }
}
MessageBox.Show("Disconnected.", "Unable to connect to chat server.", MessageBoxButtons.OK, MessageBoxIcon.Information);
//MessageBox.Show("Disconnected.", "Unable to connect to chat server.", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}

View File

@ -45,6 +45,10 @@
this.addUserToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addUserDebugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addUserReleaseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.refresh = new System.Windows.Forms.ToolStripMenuItem();
this.addToList = new System.Windows.Forms.ToolStripMenuItem();
this.peopleOnline = new System.Windows.Forms.ToolStripMenuItem();
this.toolCompile = new System.Windows.Forms.ToolStripButton();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.ModeControlTabs = new System.Windows.Forms.TabControl();
@ -58,6 +62,7 @@
this.listFPVals = new System.Windows.Forms.ListBox();
this.listFProperties = new System.Windows.Forms.ListBox();
this.pnlResourcePreview = new System.Windows.Forms.Panel();
this.listBox1 = new System.Windows.Forms.ListBox();
this.picPreview = new System.Windows.Forms.PictureBox();
this.lblResources = new System.Windows.Forms.Label();
this.btnRemoveResource = new System.Windows.Forms.Button();
@ -71,6 +76,11 @@
this.gboxBehaviorCode = new System.Windows.Forms.GroupBox();
this.txtObjectCode = new System.Windows.Forms.TextBox();
this.gboxSprite = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.radioSprite = new System.Windows.Forms.RadioButton();
this.radioDisk = new System.Windows.Forms.RadioButton();
this.radioBox = new System.Windows.Forms.RadioButton();
@ -156,11 +166,6 @@
this.txtMessage = new System.Windows.Forms.TextBox();
this.txtChat = new System.Windows.Forms.TextBox();
this.folderPrjDir = new System.Windows.Forms.FolderBrowserDialog();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.toolStrip1.SuspendLayout();
this.ModeControlTabs.SuspendLayout();
this.ResourcesTab.SuspendLayout();
@ -191,6 +196,7 @@
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolFile,
this.toolChat,
this.toolStripDropDownButton1,
this.toolCompile});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
@ -313,6 +319,42 @@
this.addUserReleaseToolStripMenuItem.Text = "Add User Release";
this.addUserReleaseToolStripMenuItem.Click += new System.EventHandler(this.addUserReleaseToolStripMenuItem_Click);
//
// toolStripDropDownButton1
//
this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.refresh,
this.addToList,
this.peopleOnline});
this.toolStripDropDownButton1.ForeColor = System.Drawing.SystemColors.ControlLight;
this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
this.toolStripDropDownButton1.Size = new System.Drawing.Size(87, 22);
this.toolStripDropDownButton1.Text = "Connections";
this.toolStripDropDownButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
//
// refresh
//
this.refresh.Name = "refresh";
this.refresh.Size = new System.Drawing.Size(148, 22);
this.refresh.Text = "Refresh";
this.refresh.Click += new System.EventHandler(this.refresh_Click);
//
// addToList
//
this.addToList.Name = "addToList";
this.addToList.Size = new System.Drawing.Size(148, 22);
this.addToList.Text = "Add to List";
this.addToList.Click += new System.EventHandler(this.addToList_Click);
//
// peopleOnline
//
this.peopleOnline.Name = "peopleOnline";
this.peopleOnline.Size = new System.Drawing.Size(148, 22);
this.peopleOnline.Text = "People Online";
this.peopleOnline.Click += new System.EventHandler(this.peopleOnline_Click);
//
// toolCompile
//
this.toolCompile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
@ -462,12 +504,23 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlResourcePreview.BackColor = System.Drawing.SystemColors.ControlDark;
this.pnlResourcePreview.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pnlResourcePreview.Controls.Add(this.listBox1);
this.pnlResourcePreview.Controls.Add(this.picPreview);
this.pnlResourcePreview.Location = new System.Drawing.Point(192, 31);
this.pnlResourcePreview.Name = "pnlResourcePreview";
this.pnlResourcePreview.Size = new System.Drawing.Size(707, 390);
this.pnlResourcePreview.TabIndex = 4;
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(477, 3);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(212, 368);
this.listBox1.TabIndex = 1;
this.listBox1.Visible = false;
this.listBox1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseClick);
//
// picPreview
//
this.picPreview.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -636,6 +689,55 @@
this.gboxSprite.TabStop = false;
this.gboxSprite.Text = "Sprites:";
//
// button1
//
this.button1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.button1.Location = new System.Drawing.Point(513, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(69, 26);
this.button1.TabIndex = 12;
this.button1.Text = "Set Size";
this.button1.UseVisualStyleBackColor = true;
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(411, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Height";
this.label2.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(313, 43);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Width";
this.label1.Visible = false;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(414, 59);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(81, 20);
this.textBox2.TabIndex = 9;
this.textBox2.Visible = false;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(316, 59);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(81, 20);
this.textBox1.TabIndex = 8;
this.textBox1.Visible = false;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// radioSprite
//
this.radioSprite.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -788,7 +890,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnInstantiate.Location = new System.Drawing.Point(5, 6);
this.btnInstantiate.Name = "btnInstantiate";
this.btnInstantiate.Size = new System.Drawing.Size(129, 23);
this.btnInstantiate.Size = new System.Drawing.Size(78, 23);
this.btnInstantiate.TabIndex = 0;
this.btnInstantiate.Text = "Instantiate Object";
this.btnInstantiate.UseVisualStyleBackColor = true;
@ -799,7 +901,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnDestroy.Location = new System.Drawing.Point(5, 35);
this.btnDestroy.Name = "btnDestroy";
this.btnDestroy.Size = new System.Drawing.Size(129, 23);
this.btnDestroy.Size = new System.Drawing.Size(78, 23);
this.btnDestroy.TabIndex = 1;
this.btnDestroy.Text = "Destroy Object";
this.btnDestroy.UseVisualStyleBackColor = true;
@ -821,7 +923,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnMove.Location = new System.Drawing.Point(6, 64);
this.btnMove.Name = "btnMove";
this.btnMove.Size = new System.Drawing.Size(128, 23);
this.btnMove.Size = new System.Drawing.Size(77, 23);
this.btnMove.TabIndex = 2;
this.btnMove.Text = "Move";
this.btnMove.UseVisualStyleBackColor = true;
@ -832,7 +934,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnScore.Location = new System.Drawing.Point(6, 93);
this.btnScore.Name = "btnScore";
this.btnScore.Size = new System.Drawing.Size(128, 23);
this.btnScore.Size = new System.Drawing.Size(77, 23);
this.btnScore.TabIndex = 3;
this.btnScore.Text = "Set Score";
this.btnScore.UseVisualStyleBackColor = true;
@ -843,7 +945,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnTimer.Location = new System.Drawing.Point(6, 151);
this.btnTimer.Name = "btnTimer";
this.btnTimer.Size = new System.Drawing.Size(128, 23);
this.btnTimer.Size = new System.Drawing.Size(77, 23);
this.btnTimer.TabIndex = 5;
this.btnTimer.Text = "Set Timer";
this.btnTimer.UseVisualStyleBackColor = true;
@ -855,7 +957,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnHealth.Location = new System.Drawing.Point(6, 122);
this.btnHealth.Name = "btnHealth";
this.btnHealth.Size = new System.Drawing.Size(128, 23);
this.btnHealth.Size = new System.Drawing.Size(77, 23);
this.btnHealth.TabIndex = 4;
this.btnHealth.Text = "Set Health";
this.btnHealth.UseVisualStyleBackColor = true;
@ -893,7 +995,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnOnCreate.Location = new System.Drawing.Point(5, 3);
this.btnOnCreate.Name = "btnOnCreate";
this.btnOnCreate.Size = new System.Drawing.Size(129, 23);
this.btnOnCreate.Size = new System.Drawing.Size(78, 23);
this.btnOnCreate.TabIndex = 4;
this.btnOnCreate.Text = "On Create";
this.btnOnCreate.UseVisualStyleBackColor = true;
@ -905,7 +1007,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnTestVar.Location = new System.Drawing.Point(5, 145);
this.btnTestVar.Name = "btnTestVar";
this.btnTestVar.Size = new System.Drawing.Size(129, 23);
this.btnTestVar.Size = new System.Drawing.Size(78, 23);
this.btnTestVar.TabIndex = 6;
this.btnTestVar.Text = "Test Variable";
this.btnTestVar.UseVisualStyleBackColor = true;
@ -916,7 +1018,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnCollision.Location = new System.Drawing.Point(5, 87);
this.btnCollision.Name = "btnCollision";
this.btnCollision.Size = new System.Drawing.Size(129, 23);
this.btnCollision.Size = new System.Drawing.Size(78, 23);
this.btnCollision.TabIndex = 2;
this.btnCollision.Text = "On Collision";
this.btnCollision.UseVisualStyleBackColor = true;
@ -928,7 +1030,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnInput.Location = new System.Drawing.Point(5, 116);
this.btnInput.Name = "btnInput";
this.btnInput.Size = new System.Drawing.Size(129, 23);
this.btnInput.Size = new System.Drawing.Size(78, 23);
this.btnInput.TabIndex = 1;
this.btnInput.Text = "Get Input";
this.btnInput.UseVisualStyleBackColor = true;
@ -940,7 +1042,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnOnDestruct.Location = new System.Drawing.Point(5, 29);
this.btnOnDestruct.Name = "btnOnDestruct";
this.btnOnDestruct.Size = new System.Drawing.Size(129, 23);
this.btnOnDestruct.Size = new System.Drawing.Size(78, 23);
this.btnOnDestruct.TabIndex = 5;
this.btnOnDestruct.Text = "On Destruct";
this.btnOnDestruct.UseVisualStyleBackColor = true;
@ -952,7 +1054,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.btnOnStep.Location = new System.Drawing.Point(5, 58);
this.btnOnStep.Name = "btnOnStep";
this.btnOnStep.Size = new System.Drawing.Size(129, 23);
this.btnOnStep.Size = new System.Drawing.Size(78, 23);
this.btnOnStep.TabIndex = 7;
this.btnOnStep.Text = "On Step";
this.btnOnStep.UseVisualStyleBackColor = true;
@ -1566,7 +1668,7 @@
// btnSendMsg
//
this.btnSendMsg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSendMsg.Location = new System.Drawing.Point(1016, 146);
this.btnSendMsg.Location = new System.Drawing.Point(1016, 134);
this.btnSendMsg.Name = "btnSendMsg";
this.btnSendMsg.Size = new System.Drawing.Size(139, 23);
this.btnSendMsg.TabIndex = 2;
@ -1577,7 +1679,7 @@
//
this.txtMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtMessage.Location = new System.Drawing.Point(3, 149);
this.txtMessage.Location = new System.Drawing.Point(3, 137);
this.txtMessage.Name = "txtMessage";
this.txtMessage.Size = new System.Drawing.Size(1006, 20);
this.txtMessage.TabIndex = 1;
@ -1592,7 +1694,7 @@
this.txtChat.Name = "txtChat";
this.txtChat.ReadOnly = true;
this.txtChat.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtChat.Size = new System.Drawing.Size(1152, 137);
this.txtChat.Size = new System.Drawing.Size(1152, 125);
this.txtChat.TabIndex = 0;
//
// folderPrjDir
@ -1601,55 +1703,6 @@
this.folderPrjDir.RootFolder = System.Environment.SpecialFolder.MyComputer;
this.folderPrjDir.SelectedPath = "System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments)";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(316, 59);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(81, 20);
this.textBox1.TabIndex = 8;
this.textBox1.Visible = false;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(414, 59);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(81, 20);
this.textBox2.TabIndex = 9;
this.textBox2.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(313, 43);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Width";
this.label1.Visible = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(411, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 11;
this.label2.Text = "Height";
this.label2.Visible = false;
//
// button1
//
this.button1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.button1.Location = new System.Drawing.Point(513, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(69, 26);
this.button1.TabIndex = 12;
this.button1.Text = "Set Size";
this.button1.UseVisualStyleBackColor = true;
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// MainWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1838,6 +1891,11 @@
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
private System.Windows.Forms.ToolStripMenuItem refresh;
private System.Windows.Forms.ToolStripMenuItem addToList;
private System.Windows.Forms.ToolStripMenuItem peopleOnline;
private System.Windows.Forms.ListBox listBox1;
}
}

View File

@ -20,6 +20,8 @@ namespace GameCreatorGroupProject
{
public partial class MainWindow : Form
{
//MainClient main = Program.getMain();
private List<uint> ilist = new List<uint>();
// Create an empty Project instance
Project project = new Project();
@ -72,8 +74,30 @@ namespace GameCreatorGroupProject
InitializeComponent();
}
private static class Prompt
{
public static string ShowDialog(string text, string caption)
{
Form prompt = new Form()
{
Width = 500,
Height = 150,
FormBorderStyle = FormBorderStyle.FixedDialog,
Text = caption,
StartPosition = FormStartPosition.CenterScreen
};
Label textLabel = new Label() { Left = 50, Top = 20, Text = text };
TextBox textBox = new TextBox() { Left = 50, Top = 50, Width = 400 };
Button confirmation = new Button() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
confirmation.Click += (sender, e) => { prompt.Close(); };
prompt.Controls.Add(textBox);
prompt.Controls.Add(confirmation);
prompt.Controls.Add(textLabel);
prompt.AcceptButton = confirmation;
return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : "";
}
}
private void itemStartServer_Click(object sender, EventArgs e)
{
@ -483,12 +507,6 @@ namespace GameCreatorGroupProject
MessageBox.Show("Connected to chat server: " + chatServerID.ToString());
/*
chat = (ChatClient) online.getAvailable();
//online.connectClient(1, chatServerID, 1);
//chat = MainClient.clients.ElementAt(0);
//chat.connectClient(ServerInfo.getServerIP());
ChatWindow cw = new ChatWindow(chat, online);
cw.Show();
*/
@ -517,7 +535,21 @@ namespace GameCreatorGroupProject
{
Thread t = new Thread(connectMain);
t.Start();
/*
TCPClient spawned;
if ((spawned = online.getAvailable()) != null)
{
if (spawned.getClientType() == 1)
{
ChatWindow cw = new ChatWindow((ChatClient)spawned, online);
cw.Show();
}
if (spawned.getClientType() == 2)
{
//input code for making resource gui popup
}
}
*/
Thread ts = new Thread(spawnReq);
ts.Start();
}
@ -526,18 +558,16 @@ namespace GameCreatorGroupProject
private void spawnReq()
{
//bool hasCon = false;
while (online.isConnected())
{
Thread.Sleep(0);
//hasCon = true;
TCPClient spawned;
if ((spawned = online.getAvailable()) != null)
{
if (spawned.getClientType() == 1)
{
ChatWindow cw = new ChatWindow((ChatClient)spawned, online);
cw.Show();
Thread ts = new Thread(startChatGUI);
ts.Start(spawned);
}
if (spawned.getClientType() == 2)
{
@ -548,6 +578,12 @@ namespace GameCreatorGroupProject
}
private void startChatGUI(object c)
{
Application.Run(new ChatWindow((ChatClient)c, online));
}
//connects the main client to the server
private void connectMain()
@ -1658,6 +1694,73 @@ namespace GameCreatorGroupProject
}
}
private void listBox1_MouseClick(object sender, MouseEventArgs e)
{
if (listBox1.Visible == true)
{
int index = this.listBox1.IndexFromPoint(e.Location);
if (index != System.Windows.Forms.ListBox.NoMatches)
{
DialogResult result = MessageBox.Show("Would you like to connect to the chat?", "Chat Dialogue", MessageBoxButtons.YesNo);
if (result.ToString() == "Yes")
{
try
{
chatServerID = online.requestChatServer();
}
catch (notConnectedException)
{
MessageBox.Show("Could not connect to chat server, not connected to server.", "Not connected to server", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
MessageBox.Show("Connected to chat server: " + chatServerID.ToString());
/*
chat = (ChatClient)online.getAvailable();
ChatWindow cw = new ChatWindow(chat, online);
cw.Show();
*/
}
}
}
}
private void refresh_Click(object sender, EventArgs e)
{
for (int i = 0; i < ilist.Count; i++)
{
if (online.isOnline(ilist[i]) == true)
{
listBox1.Items.Add(ilist[i] + " Online");
}
else
listBox1.Items.Add(ilist[i] + " Offline");
}
}
private void addToList_Click(object sender, EventArgs e)
{
string text;
uint ID;
text = Prompt.ShowDialog("Insert ClientID", "Add to List");
//Interaction.InputBox("instert ID");
if (UInt32.TryParse(text, out ID) == true)
{
ilist.Add(ID);
}
else
{
MessageBox.Show("thats number is not proper");
}
}
private void peopleOnline_Click(object sender, EventArgs e)
{
if (listBox1.Visible == true)
{
listBox1.Visible = false;
}
else
listBox1.Visible = true;
}
}
}

View File

@ -134,6 +134,21 @@
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolCompile.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -40,7 +40,7 @@ namespace GameCreatorGroupProject
private bool dc;
private Queue<TCPClient> available = new Queue<TCPClient>();
static public Queue<TCPClient> available = new Queue<TCPClient>();
//main port
private readonly int port = 20112;
@ -168,7 +168,7 @@ namespace GameCreatorGroupProject
//gives thread enhanced priority to attempt to connect as quickly as possible
t.Priority = ThreadPriority.AboveNormal;
t.Start(c);
available.Enqueue(c);
clients.Add(c);
}
}
@ -200,6 +200,7 @@ namespace GameCreatorGroupProject
throw new ArgumentNullException("No client to connect");
}
((TCPClient)connectClient).connectClient(ServerInfo.getServerIP());
}
//sends request for server type specified by message, and sends request for connection for itself
@ -307,9 +308,16 @@ namespace GameCreatorGroupProject
//querys if specified user is online
public bool isOnline(uint clientID)
{
staticWriter.Write((byte)5);
staticWriter.Write(clientID);
return staticReader.ReadBoolean();
if (staticWriter != null && staticReader != null)
{
staticWriter.Write((byte)5);
staticWriter.Write(clientID);
return staticReader.ReadBoolean();
}
else
{
return false;
}
}

View File

@ -9,6 +9,7 @@ namespace GameCreatorGroupProject
{
static class Program
{
private static MainClient online = null;
public static bool connected = false;
/// <summary>
/// The main entry point for the application.
@ -16,11 +17,39 @@ namespace GameCreatorGroupProject
[STAThread]
static void Main()
{
online = new MainClient();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainWindow());
}
// making these connect to the functions in online so that they can be easier used in the Form
public static void connect()
{
Thread t = new Thread(connectMain);
t.Start();
}
//connects the main client to the server
private static void connectMain()
{
online.connectClient(ServerInfo.getServerIP());
}
public static void disconnect()
{
online.disconnect();
}
public static bool Online(uint clientID)
{
return online.isOnline(clientID);
}
public static MainClient getMain()
{
return online;
}
}
}

View File

@ -20,7 +20,7 @@ namespace GameCreatorGroupProject
private StreamWriter writer = null;
private StreamReader reader = null;
//chat port
//resource port
private readonly int port = 20115;
public static readonly byte serverType = 2;
private uint serverID;
@ -120,9 +120,12 @@ namespace GameCreatorGroupProject
}
}
public override int getClientType()
{
return serverType;
}
}
}

View File

@ -13,7 +13,7 @@ namespace GameCreatorGroupProject
{
public abstract class TCPClient
{
protected TcpClient client = null;
public TcpClient client = null;
protected NetworkStream stream = null;
//connects to a server

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@ -1,174 +1,29 @@
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\Jared\Documents\GitHub\mod14\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\Jared\Documents\GitHub\mod17\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\Jared\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\AquaC\Desktop\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
<<<<<<< HEAD
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\Jared\Documents\GitHub\modalot\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\justi_000\Source\Repos\CS-350-410-431-Group-Project2\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\fs.glsl
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\fs_tex.glsl
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\vs.glsl
C:\Users\Cor\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\vs_tex.glsl
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\fs.glsl
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\fs_tex.glsl
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\vs.glsl
C:\Users\dpuli\OneDrive\Documents\GitHub\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\vs_tex.glsl
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\fs.glsl
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\fs_tex.glsl
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\vs.glsl
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\vs_tex.glsl
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\Jared\Documents\GitHub\modmore\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
=======
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\AquaC\Projects\CS-350-410-431-Group-Project\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
>>>>>>> b1f9e660103dc9f5de79a6fdb9b050399778f499
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.Compatibility.dll
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.dll
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.dll
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\Cody\Downloads\CS-350-410-431-Group-Project-master (9)\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe.config
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.exe
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.pdb
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.exe
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\GameCreatorGroupProject.pdb
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.pdb
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.xml
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Debug\OpenTK.GLControl.xml
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csprojResolveAssemblyReference.cache
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.CollisionDesigner.resources
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.MainWindow.resources
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.ChatWindow.resources
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\obj\Debug\GameCreatorGroupProject.csproj.GenerateResource.Cache

View File

@ -0,0 +1 @@
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\GameCreatorGroupProject\GameCreatorGroupProject\bin\Release\GameCreatorGroupProject.exe.config

View File

@ -34,24 +34,6 @@ namespace Server_Application_Console
this.serverID = serverID;
}
/*
public static void setConnectExpected(bool expected)
{
if(expected)
{
connectExpected.Set();
}
else
{
connectExpected.Reset();
}
}
public static bool getConnectExpected()
{
return connectExpected.IsSet;
}
*/
public static uint getCurrentID()
{
return currentID;
@ -86,7 +68,7 @@ namespace Server_Application_Console
{
Thread.Sleep(0);
//checks if a new client is waiting to connect
if (listener.Pending() && currentID == serverID)
if (currentID == serverID)
{
//connects to client
TcpClient client = await listener.AcceptTcpClientAsync();
@ -133,26 +115,22 @@ namespace Server_Application_Console
{
Thread.Sleep(0);
//checks if data is available on the clients stream
if (inStream.DataAvailable)
message = reader.ReadLine();
//sends data to all clients in chat
foreach (KeyValuePair<TcpClient, string> c in clientList)
{
message = reader.ReadLine();
//sends data to all clients in chat
foreach (KeyValuePair<TcpClient, string> c in clientList)
{
string clientName;
string clientName;
//creates StreamWriter for current outgoing client
outStream = c.Key.GetStream();
writer = new StreamWriter(outStream);
//appends sender name to beginning of message
clientList.TryGetValue(thisClient, out clientName);
//writes sender and message to outgoing stream
writer.WriteLine(clientName + ": " + message.ToString());
Console.WriteLine(clientName + ": " + message.ToString());
writer.Flush();
}
//creates StreamWriter for current outgoing client
outStream = c.Key.GetStream();
writer = new StreamWriter(outStream);
//appends sender name to beginning of message
clientList.TryGetValue(thisClient, out clientName);
//writes sender and message to outgoing stream
writer.WriteLine(clientName + ": " + message.ToString());
Console.WriteLine(clientName + ": " + message.ToString());
writer.Flush();
}
}
if (writer != null) { writer.Close(); }

View File

@ -45,30 +45,26 @@ namespace Server_Application_Console
while (running)
{
//checks if a new client is waiting to connect
//if (listener.Pending())
// {
//connects to client
//currently connects to any client, possibly add security later
TcpClient client = await listener.AcceptTcpClientAsync();
//TcpClient client = listener.AcceptTcpClient();
NetworkStream stream = client.GetStream();
BinaryReader reader = new BinaryReader(stream);
byte type = reader.ReadByte();
//connects to client
//currently connects to any client, possibly add security later
TcpClient client = await listener.AcceptTcpClientAsync();
NetworkStream stream = client.GetStream();
BinaryReader reader = new BinaryReader(stream);
byte type = reader.ReadByte();
//client type sends requests to server
if (type == 0)
{
Thread t = new Thread(transmitter);
t.Start(client);
}
//client type waits for requests from server
else if (type == 1)
{
uint thisClientID = reader.ReadUInt32();
//adds client to a dictionary for use
clientList.Add(thisClientID, client);
}
//}
//client type sends requests to server
if (type == 0)
{
Thread t = new Thread(transmitter);
t.Start(client);
}
//client type waits for requests from server
else if (type == 1)
{
uint thisClientID = reader.ReadUInt32();
//adds client to a dictionary for use
clientList.Add(thisClientID, client);
}
}
}
@ -86,165 +82,160 @@ namespace Server_Application_Console
//control while client connected and server running
while (thisClient.Connected && running)
{
Thread.Sleep(0);
//checks if data is available on the clients stream
if (stream.DataAvailable)
//gets the type of request sent by the client
byte reqType = reader.ReadByte();
switch (reqType)
{
//gets the type of request sent by the client
byte reqType = reader.ReadByte();
switch (reqType)
{
//request for chat server
case 1:
//locks to ensure server counter not modified by another thread
lock (serverCounterLock)
//request for chat server
case 1:
//locks to ensure server counter not modified by another thread
lock (serverCounterLock)
{
//increments server counter
serverCounter++;
//creates chat server with serverCounter as its ID in new thread
Thread tC = new Thread(startChatServer);
tC.Start(serverCounter);
//writes the assigned serverID to client
writer.Write(serverCounter);
}
break;
//request for resource server
case 2:
//locks to ensure server counter not modified by another thread
lock (serverCounterLock)
{
//increments server counter
serverCounter++;
//creates resource server with serverCounter as its ID in new thread
Thread tR = new Thread(startResourceServer);
tR.Start(serverCounter);
//writes the assigned serverID to client
writer.Write(serverCounter);
}
break;
//request for real time collaboration server
case 3:
//locks to ensure server counter not modified by another thread
lock (serverCounterLock)
{
//increments server counter
serverCounter++;
//creates real time collaboration server with serverCounter as its ID in new thread
Thread tRTC = new Thread(startRTCServer);
tRTC.Start(serverCounter);
//writes the assigned serverID to client
writer.Write(serverCounter);
}
break;
//request to connect a client to a server
case 4:
TcpClient connect;
//reads connection info from stream
byte serType = reader.ReadByte();
uint serverID = reader.ReadUInt32();
uint clientID = reader.ReadUInt32();
//checks if specified client connected, and gets corresponding TcpClient
if (clientList.TryGetValue(clientID, out connect))
{
//creates reader and writer on requested clients stream
NetworkStream cStream = connect.GetStream();
BinaryWriter cWriter = new BinaryWriter(cStream);
//indicates whether client successfully connected
bool success = false;
//checks the type of server connection request for
switch (serType)
{
//increments server counter
serverCounter++;
//creates chat server with serverCounter as its ID in new thread
Thread tC = new Thread(startChatServer);
tC.Start(serverCounter);
//writes the assigned serverID to client
writer.Write(serverCounter);
//connection request for chat server
case 1:
//locks to ensure ChatServer's currentID is not changed
lock (ChatServer.IDLock)
{
//tells chat servers listener that incoming request is for server with specified ID
ChatServer.setCurrentID(serverID);
ChatServer.setExpectedClient(clientID);
//tells chat server that a connection is expected
ChatServer.connectExpected.Set();
//tells client to connect
cWriter.Write(serType);
cWriter.Write(serverID);
//waits for client to connect to unlock, connectExpected set to false when it does
success = ChatServer.connected.Wait(TimeSpan.FromSeconds(5));
//ensures values reset regardless of outcome
ChatServer.connectExpected.Reset();
ChatServer.connected.Reset();
}
break;
//connection request for resource server
case 2:
//structure same as chat server, see comments for case 1
lock (ResourceServer.IDLock)
{
ResourceServer.setCurrentID(serverID);
ResourceServer.setExpectedClient(clientID);
ResourceServer.connectExpected.Set();
cWriter.Write(serType);
cWriter.Write(serverID);
success = ResourceServer.connected.Wait(TimeSpan.FromSeconds(5));
//ensures values reset regardless of outcome
ResourceServer.connectExpected.Reset();
ResourceServer.connected.Reset();
}
break;
//connection request for real time collaboration server
case 3:
//structure same as chat server, see comments for case 1
lock (RTCServer.IDLock)
{
RTCServer.setCurrentID(serverID);
RTCServer.setExpectedClient(clientID);
RTCServer.connectExpected.Set();
cWriter.Write(serType);
cWriter.Write(serverID);
success = RTCServer.connected.Wait(TimeSpan.FromSeconds(5));
//ensures values reset regardless of outcome
RTCServer.connectExpected.Reset();
RTCServer.connected.Reset();
}
break;
}
break;
//request for resource server
case 2:
//locks to ensure server counter not modified by another thread
lock (serverCounterLock)
//checks if requested client still connected
if (connect.Connected && success)
{
//increments server counter
serverCounter++;
//creates resource server with serverCounter as its ID in new thread
Thread tR = new Thread(startResourceServer);
tR.Start(serverCounter);
//writes the assigned serverID to client
writer.Write(serverCounter);
}
break;
//request for real time collaboration server
case 3:
//locks to ensure server counter not modified by another thread
lock (serverCounterLock)
{
//increments server counter
serverCounter++;
//creates real time collaboration server with serverCounter as its ID in new thread
Thread tRTC = new Thread(startRTCServer);
tRTC.Start(serverCounter);
//writes the assigned serverID to client
writer.Write(serverCounter);
}
break;
//request to connect a client to a server
case 4:
TcpClient connect;
//reads connection info from stream
byte serType = reader.ReadByte();
uint serverID = reader.ReadUInt32();
uint clientID = reader.ReadUInt32();
//checks if specified client connected, and gets corresponding TcpClient
if (clientList.TryGetValue(clientID, out connect))
{
//creates reader and writer on requested clients stream
NetworkStream cStream = connect.GetStream();
BinaryWriter cWriter = new BinaryWriter(cStream);
//indicates whether client successfully connected
bool success = false;
//checks the type of server connection request for
switch (serType)
{
//connection request for chat server
case 1:
//locks to ensure ChatServer's currentID is not changed
lock (ChatServer.IDLock)
{
//tells chat servers listener that incoming request is for server with specified ID
ChatServer.setCurrentID(serverID);
ChatServer.setExpectedClient(clientID);
//tells chat server that a connection is expected
ChatServer.connectExpected.Set();
//tells client to connect
cWriter.Write(serType);
cWriter.Write(serverID);
//waits for client to connect to unlock, connectExpected set to false when it does
success = ChatServer.connected.Wait(TimeSpan.FromSeconds(5));
//ensures values reset regardless of outcome
ChatServer.connectExpected.Reset();
ChatServer.connected.Reset();
}
break;
//connection request for resource server
case 2:
//structure same as chat server, see comments for case 1
lock (ResourceServer.IDLock)
{
ResourceServer.setCurrentID(serverID);
ResourceServer.setExpectedClient(clientID);
ResourceServer.connectExpected.Set();
cWriter.Write(serType);
cWriter.Write(serverID);
success = ResourceServer.connected.Wait(TimeSpan.FromSeconds(5));
//ensures values reset regardless of outcome
ResourceServer.connectExpected.Reset();
ResourceServer.connected.Reset();
}
break;
//connection request for real time collaboration server
case 3:
//structure same as chat server, see comments for case 1
lock (RTCServer.IDLock)
{
RTCServer.setCurrentID(serverID);
RTCServer.setExpectedClient(clientID);
RTCServer.connectExpected.Set();
cWriter.Write(serType);
cWriter.Write(serverID);
success = RTCServer.connected.Wait(TimeSpan.FromSeconds(5));
//ensures values reset regardless of outcome
RTCServer.connectExpected.Reset();
RTCServer.connected.Reset();
}
break;
}
//checks if requested client still connected
if (connect.Connected && success)
{
//tells requester client successfully connected if it is
writer.Write(true);
}
else
{
//else indicates connection unsuccessful
writer.Write(false);
}
}
//requested client not connected
else
{
//tells client connection request was unsuccessful
writer.Write(false);
}
break;
//request for status of indicated client
case 5:
TcpClient temp;
//checks if indicated client is in list of connected clients
if (clientList.TryGetValue(reader.ReadUInt32(), out temp))
{
//tells requester specified client is connected
//tells requester client successfully connected if it is
writer.Write(true);
}
else
{
//tells requester specified client is not connected
//else indicates connection unsuccessful
writer.Write(false);
}
break;
}
}
//requested client not connected
else
{
//tells client connection request was unsuccessful
writer.Write(false);
}
break;
//request for status of indicated client
case 5:
TcpClient temp;
//checks if indicated client is in list of connected clients
if (clientList.TryGetValue(reader.ReadUInt32(), out temp))
{
//tells requester specified client is connected
writer.Write(true);
}
else
{
//tells requester specified client is not connected
writer.Write(false);
}
break;
}
}

View File

@ -1,6 +1,6 @@
C:\Users\Jared\Documents\GitHub\modmore\Server Application Console\Server Application Console\bin\Debug\Server Application Console.exe.config
C:\Users\Jared\Documents\GitHub\modmore\Server Application Console\Server Application Console\bin\Debug\Server Application Console.exe
C:\Users\Jared\Documents\GitHub\modmore\Server Application Console\Server Application Console\bin\Debug\Server Application Console.pdb
C:\Users\Jared\Documents\GitHub\modmore\Server Application Console\Server Application Console\obj\Debug\Server Application Console.csprojResolveAssemblyReference.cache
C:\Users\Jared\Documents\GitHub\modmore\Server Application Console\Server Application Console\obj\Debug\Server Application Console.exe
C:\Users\Jared\Documents\GitHub\modmore\Server Application Console\Server Application Console\obj\Debug\Server Application Console.pdb
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\Server Application Console\Server Application Console\bin\Debug\Server Application Console.exe.config
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\Server Application Console\Server Application Console\bin\Debug\Server Application Console.exe
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\Server Application Console\Server Application Console\bin\Debug\Server Application Console.pdb
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\Server Application Console\Server Application Console\obj\Debug\Server Application Console.csprojResolveAssemblyReference.cache
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\Server Application Console\Server Application Console\obj\Debug\Server Application Console.exe
C:\Users\cdyrd\Desktop\CS-350-410-431-Group-Project-master\CS-350-410-431-Group-Project-master\Server Application Console\Server Application Console\obj\Debug\Server Application Console.pdb