Skip to content

Commit f87d447

Browse files
committed
Added buttons for various things and packet checking
1 parent 6090957 commit f87d447

18 files changed

+1195
-26
lines changed

AM2R Server.project.gmx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,16 @@
3838
</ConfigOptions>
3939
<filename>item_dict.json</filename>
4040
</datafile>
41-
<datafile>
42-
<name>settings.ini</name>
43-
<exists>-1</exists>
44-
<size>0</size>
45-
<exportAction>2</exportAction>
46-
<exportDir></exportDir>
47-
<overwrite>0</overwrite>
48-
<freeData>-1</freeData>
49-
<removeEnd>0</removeEnd>
50-
<store>0</store>
51-
<ConfigOptions>
52-
<Config name="Default">
53-
<CopyToMask>9223372036854775807</CopyToMask>
54-
</Config>
55-
</ConfigOptions>
56-
<filename>settings.ini</filename>
57-
</datafile>
5841
</datafiles>
5942
<NewExtensions/>
6043
<sounds name="sound"/>
61-
<sprites name="sprites"/>
44+
<sprites name="sprites">
45+
<sprite>sprites\sPort</sprite>
46+
<sprite>sprites\sReset</sprite>
47+
<sprite>sprites\sLoad</sprite>
48+
<sprite>sprites\sSave</sprite>
49+
<sprite>sprites\sClients</sprite>
50+
</sprites>
6251
<backgrounds name="background"/>
6352
<paths name="paths"/>
6453
<scripts name="scripts">
@@ -76,6 +65,11 @@
7665
</fonts>
7766
<objects name="objects">
7867
<object>objects\oServer</object>
68+
<object>objects\oPort</object>
69+
<object>objects\oSave</object>
70+
<object>objects\oLoad</object>
71+
<object>objects\oReset</object>
72+
<object>objects\oClients</object>
7973
</objects>
8074
<rooms name="rooms">
8175
<room>rooms\room0</room>

objects/oClients.object.gmx

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
2+
<object>
3+
<spriteName>sClients</spriteName>
4+
<solid>0</solid>
5+
<visible>-1</visible>
6+
<depth>0</depth>
7+
<persistent>0</persistent>
8+
<parentName>&lt;undefined&gt;</parentName>
9+
<maskName>&lt;undefined&gt;</maskName>
10+
<events>
11+
<event eventtype="2" enumb="0">
12+
<action>
13+
<libid>1</libid>
14+
<id>603</id>
15+
<kind>7</kind>
16+
<userelative>0</userelative>
17+
<isquestion>0</isquestion>
18+
<useapplyto>-1</useapplyto>
19+
<exetype>2</exetype>
20+
<functionname></functionname>
21+
<codestring></codestring>
22+
<whoName>self</whoName>
23+
<relative>0</relative>
24+
<isnot>0</isnot>
25+
<arguments>
26+
<argument>
27+
<kind>1</kind>
28+
<string>if(!instance_exists(oServer)){
29+
instance_create(0, 0, oServer);
30+
}
31+
</string>
32+
</argument>
33+
</arguments>
34+
</action>
35+
</event>
36+
<event eventtype="6" enumb="4">
37+
<action>
38+
<libid>1</libid>
39+
<id>603</id>
40+
<kind>7</kind>
41+
<userelative>0</userelative>
42+
<isquestion>0</isquestion>
43+
<useapplyto>-1</useapplyto>
44+
<exetype>2</exetype>
45+
<functionname></functionname>
46+
<codestring></codestring>
47+
<whoName>self</whoName>
48+
<relative>0</relative>
49+
<isnot>0</isnot>
50+
<arguments>
51+
<argument>
52+
<kind>1</kind>
53+
<string>msg = get_integer_async("Type in the max number of clients you want to connect. The server will automatically restart.", 8);
54+
</string>
55+
</argument>
56+
</arguments>
57+
</action>
58+
</event>
59+
<event eventtype="7" enumb="63">
60+
<action>
61+
<libid>1</libid>
62+
<id>603</id>
63+
<kind>7</kind>
64+
<userelative>0</userelative>
65+
<isquestion>0</isquestion>
66+
<useapplyto>-1</useapplyto>
67+
<exetype>2</exetype>
68+
<functionname></functionname>
69+
<codestring></codestring>
70+
<whoName>self</whoName>
71+
<relative>0</relative>
72+
<isnot>0</isnot>
73+
<arguments>
74+
<argument>
75+
<kind>1</kind>
76+
<string>var ID = ds_map_find_value(async_load, "id");
77+
78+
if(ID == msg){
79+
if(ds_map_find_value(async_load, "status")){
80+
var input = ds_map_find_value(async_load, "value");
81+
if(is_real(input)){
82+
ini_open(working_directory + "\settings.ini");
83+
var maxClients = ini_read_real("Settings", "maxplayers", 8);
84+
ini_close();
85+
86+
if(input != maxClients){
87+
if(instance_exists(oServer)){
88+
with(oServer){
89+
instance_destroy();
90+
}
91+
ini_open(working_directory + "\settings.ini");
92+
ini_write_real("Settings", "maxplayers", input);
93+
ini_close();
94+
alarm[0] = 180;
95+
}
96+
}
97+
}
98+
}
99+
}
100+
</string>
101+
</argument>
102+
</arguments>
103+
</action>
104+
</event>
105+
<event eventtype="8" enumb="0">
106+
<action>
107+
<libid>1</libid>
108+
<id>603</id>
109+
<kind>7</kind>
110+
<userelative>0</userelative>
111+
<isquestion>0</isquestion>
112+
<useapplyto>-1</useapplyto>
113+
<exetype>2</exetype>
114+
<functionname></functionname>
115+
<codestring></codestring>
116+
<whoName>self</whoName>
117+
<relative>0</relative>
118+
<isnot>0</isnot>
119+
<arguments>
120+
<argument>
121+
<kind>1</kind>
122+
<string>draw_self();
123+
if(!instance_exists(oServer)){
124+
draw_text(5, 5, "Server restarting...");
125+
}
126+
127+
128+
129+
</string>
130+
</argument>
131+
</arguments>
132+
</action>
133+
</event>
134+
</events>
135+
<PhysicsObject>0</PhysicsObject>
136+
<PhysicsObjectSensor>0</PhysicsObjectSensor>
137+
<PhysicsObjectShape>0</PhysicsObjectShape>
138+
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
139+
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
140+
<PhysicsObjectGroup>0</PhysicsObjectGroup>
141+
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
142+
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
143+
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
144+
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
145+
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
146+
<PhysicsShapePoints/>
147+
</object>

objects/oLoad.object.gmx

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
2+
<object>
3+
<spriteName>sLoad</spriteName>
4+
<solid>0</solid>
5+
<visible>-1</visible>
6+
<depth>0</depth>
7+
<persistent>0</persistent>
8+
<parentName>&lt;undefined&gt;</parentName>
9+
<maskName>&lt;undefined&gt;</maskName>
10+
<events>
11+
<event eventtype="2" enumb="0">
12+
<action>
13+
<libid>1</libid>
14+
<id>603</id>
15+
<kind>7</kind>
16+
<userelative>0</userelative>
17+
<isquestion>0</isquestion>
18+
<useapplyto>-1</useapplyto>
19+
<exetype>2</exetype>
20+
<functionname></functionname>
21+
<codestring></codestring>
22+
<whoName>self</whoName>
23+
<relative>0</relative>
24+
<isnot>0</isnot>
25+
<arguments>
26+
<argument>
27+
<kind>1</kind>
28+
<string></string>
29+
</argument>
30+
</arguments>
31+
</action>
32+
</event>
33+
<event eventtype="6" enumb="4">
34+
<action>
35+
<libid>1</libid>
36+
<id>603</id>
37+
<kind>7</kind>
38+
<userelative>0</userelative>
39+
<isquestion>0</isquestion>
40+
<useapplyto>-1</useapplyto>
41+
<exetype>2</exetype>
42+
<functionname></functionname>
43+
<codestring></codestring>
44+
<whoName>self</whoName>
45+
<relative>0</relative>
46+
<isnot>0</isnot>
47+
<arguments>
48+
<argument>
49+
<kind>1</kind>
50+
<string>if(instance_exists(oServer)){
51+
with(oServer) event_user(2);
52+
alarm[0] = 120;
53+
}
54+
</string>
55+
</argument>
56+
</arguments>
57+
</action>
58+
</event>
59+
<event eventtype="8" enumb="0">
60+
<action>
61+
<libid>1</libid>
62+
<id>603</id>
63+
<kind>7</kind>
64+
<userelative>0</userelative>
65+
<isquestion>0</isquestion>
66+
<useapplyto>-1</useapplyto>
67+
<exetype>2</exetype>
68+
<functionname></functionname>
69+
<codestring></codestring>
70+
<whoName>self</whoName>
71+
<relative>0</relative>
72+
<isnot>0</isnot>
73+
<arguments>
74+
<argument>
75+
<kind>1</kind>
76+
<string>draw_self();
77+
if(alarm[0] &gt; 0){
78+
draw_set_halign(fa_right);
79+
draw_text(x - 12, y + 12, "Stats loaded!");
80+
draw_set_halign(fa_left);
81+
}
82+
</string>
83+
</argument>
84+
</arguments>
85+
</action>
86+
</event>
87+
</events>
88+
<PhysicsObject>0</PhysicsObject>
89+
<PhysicsObjectSensor>0</PhysicsObjectSensor>
90+
<PhysicsObjectShape>0</PhysicsObjectShape>
91+
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
92+
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
93+
<PhysicsObjectGroup>0</PhysicsObjectGroup>
94+
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
95+
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
96+
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
97+
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
98+
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
99+
<PhysicsShapePoints/>
100+
</object>

0 commit comments

Comments
 (0)