This contains the bare minimum for co-op to work with no QoL features. More on the way.pull/1/head
parent
7364ede476
commit
3c23ec0044
@ -0,0 +1,334 @@
|
||||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<object>
|
||||
<spriteName><undefined></spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>0</visible>
|
||||
<depth>0</depth>
|
||||
<persistent>-1</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<event eventtype="0" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>strict_init("dictionary.json");
|
||||
canSend = false;
|
||||
alarm[1] = 300;
|
||||
var type;
|
||||
type = network_socket_tcp;
|
||||
var file = file_text_open_read(working_directory + "\ipaddress.txt");
|
||||
ipaddress = file_text_read_string(file);
|
||||
file_text_close(file);
|
||||
port = 64198;
|
||||
socket = network_create_socket(type);
|
||||
isConnected = network_connect(socket, ipaddress, port);
|
||||
|
||||
var size, type, alignment;
|
||||
size = 1024;
|
||||
type = buffer_grow;
|
||||
alignment = 1;
|
||||
buffer = buffer_create(size, type, alignment);
|
||||
|
||||
global.itemlist[0] = 0;
|
||||
for(i=0; i<350; i++){
|
||||
global.itemlist[i] = i;
|
||||
}
|
||||
|
||||
global.onlineList = ds_grid_create(3, 33);
|
||||
global.onlineSend = ds_grid_create(3, 33);
|
||||
for(var i=0; i<ds_grid_height(global.onlineList); i++){
|
||||
ds_grid_set(global.onlineList, 2, i, i);
|
||||
}
|
||||
|
||||
update_variables("prev");
|
||||
|
||||
update_variables("onlinevars");
|
||||
|
||||
alarm[0] = 5;
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="1" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>network_destroy(socket);
|
||||
buffer_delete(buffer);
|
||||
ds_grid_destroy(global.onlineList);
|
||||
ds_grid_destroy(global.onlineSend);
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="2" enumb="1">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>/*
|
||||
if(isConnected < 0){
|
||||
isConnected = network_connect(socket, ipaddress, port);
|
||||
}
|
||||
alarm[1] = 300;
|
||||
*/
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="2" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>
|
||||
update_variables("onlinevars");
|
||||
|
||||
for(var i=0; i<ds_grid_height(global.onlineList); i++){
|
||||
if(global.onlineList[# 0, i] != global.onlineList[# 1, i] && i != 0 && i != 1 && i != 3){
|
||||
global.onlineSend[# 0, i] = global.onlineList[# 0, i];
|
||||
global.onlineSend[# 1, i] = global.onlineList[# 1, i];
|
||||
global.onlineSend[# 2, i] = global.onlineList[# 2, i];
|
||||
canSend = true;
|
||||
alarm[0] = 600;
|
||||
}
|
||||
|
||||
if(i == 0){
|
||||
for(var f=0; f<array_length_1d(global.item); f++){
|
||||
if(global.itemPrev[f] != global.item[f]){
|
||||
global.onlineSend[# 0, 0] = global.onlineList[# 0, 0];
|
||||
global.onlineSend[# 1, 0] = global.onlineList[# 1, 0];
|
||||
global.onlineSend[# 2, 0] = global.onlineList[# 2, 0];
|
||||
show_debug_message(string(global.itemPrev[f]) + " " + string(global.item[f]));
|
||||
show_debug_message("item changed");
|
||||
canSend = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(i == 1){
|
||||
for(var f=0; f<array_length_1d(global.metdead); f++){
|
||||
if(global.metdeadPrev[f] != global.metdead[f]){
|
||||
global.onlineSend[# 0, 1] = global.onlineList[# 0, 1];
|
||||
global.onlineSend[# 1, 1] = global.onlineList[# 1, 1];
|
||||
global.onlineSend[# 2, 1] = global.onlineList[# 2, 1];
|
||||
show_debug_message(string(global.metdeadPrev[f]) + " " + string(global.metdead[f]));
|
||||
show_debug_message("metdead changed");
|
||||
canSend = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(i == 3){
|
||||
for(var f=0; f<array_length_1d(global.event); f++){
|
||||
if(global.eventPrev[f] != global.event[f]){
|
||||
global.onlineSend[# 0, 3] = global.onlineList[# 0, 3];
|
||||
global.onlineSend[# 1, 3] = global.onlineList[# 1, 3];
|
||||
global.onlineSend[# 2, 3] = global.onlineList[# 2, 3];
|
||||
show_debug_message(string(global.eventPrev[f]) + " " + string(global.event[f]));
|
||||
show_debug_message("event changed");
|
||||
canSend = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(canSend){
|
||||
show_debug_message("missiles");
|
||||
show_debug_message(string(global.missilesPrev) + " " + string(global.missiles));
|
||||
buffer_delete(buffer);
|
||||
var size, type, alignment;
|
||||
size = 1024;
|
||||
type = buffer_grow;
|
||||
alignment = 1;
|
||||
buffer = buffer_create(size, type, alignment);
|
||||
buffer_seek(buffer, buffer_seek_start, 0);
|
||||
buffer_write(buffer, buffer_string, strict_compress(ds_grid_write(global.onlineSend)));
|
||||
var result = network_send_packet(socket, buffer, buffer_tell(buffer));
|
||||
canSend = false;
|
||||
}
|
||||
|
||||
if(!canSend){
|
||||
alarm[0] = 30;
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="3" enumb="0">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>if(keyboard_check_pressed(vk_f2)){
|
||||
instance_destroy();
|
||||
}
|
||||
|
||||
if(keyboard_check_pressed(vk_f3)){
|
||||
var f = 0;
|
||||
repeat(41){
|
||||
global.metdead[f] = 1;
|
||||
f++;
|
||||
}
|
||||
}
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="7" enumb="68">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>
|
||||
var type_event = ds_map_find_value(async_load, "type");
|
||||
|
||||
switch(type_event){
|
||||
case network_type_data:
|
||||
var _buffer = ds_map_find_value(async_load, "buffer");
|
||||
show_debug_message(buffer_get_size(_buffer));
|
||||
buffer_seek(_buffer, buffer_seek_start, 0);
|
||||
ds_grid_read(global.onlineSend, strict_decompress(buffer_read(_buffer, buffer_string)));
|
||||
update_variables("disablesame");
|
||||
update_variables("replaceglobalvars");
|
||||
update_variables("prev");
|
||||
alarm[0] = 30;
|
||||
ds_grid_clear(global.onlineSend, 0);
|
||||
/*
|
||||
for(var i=0; i<array_length_1d(vars); i++){
|
||||
if(global.onlineVars[i, 1] != vars[i, 1]){
|
||||
global.onlineVars[i, 1] = vars[i, 1];
|
||||
global.onlineVars[i, 0] = global.onlineVars[i, 1];
|
||||
}
|
||||
}
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="7" enumb="3">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>2</exetype>
|
||||
<functionname></functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>self</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
<arguments>
|
||||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>network_destroy(socket);
|
||||
buffer_delete(buffer);
|
||||
ds_grid_destroy(global.onlineList);
|
||||
ds_grid_destroy(global.onlineSend);
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
</events>
|
||||
<PhysicsObject>0</PhysicsObject>
|
||||
<PhysicsObjectSensor>0</PhysicsObjectSensor>
|
||||
<PhysicsObjectShape>0</PhysicsObjectShape>
|
||||
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
|
||||
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
|
||||
<PhysicsObjectGroup>0</PhysicsObjectGroup>
|
||||
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
|
||||
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
|
||||
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
|
||||
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
|
||||
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
|
||||
<PhysicsShapePoints/>
|
||||
</object>
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,7 @@
|
||||
var i, tempArray;
|
||||
tempArray = argument[0];
|
||||
for(i=0; i<array_length_1d(tempArray); i++){
|
||||
if(tempArray[i]==argument[1])
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
@ -0,0 +1,55 @@
|
||||
///strict_compress(input)
|
||||
|
||||
/*
|
||||
Description: Returns a compressed version of the provided input string
|
||||
Arguments: input (string)
|
||||
Returns: String
|
||||
*/
|
||||
|
||||
var input, input_size, index, output, ml, dict, verb;
|
||||
|
||||
input = argument0;
|
||||
input_size = string_length(input);
|
||||
index = 1;
|
||||
output = "";
|
||||
ml = _strict_data[? "max_length"];
|
||||
dict = _strict_data[? "dictionary"];
|
||||
verb = "";
|
||||
|
||||
while(index <= input_size) {
|
||||
var l = min(input_size-(index-1),ml);
|
||||
var q = "";
|
||||
for(var c = l; c > 0; c--) {
|
||||
var code = ds_map_find_value(dict,string_copy(input,index,c));
|
||||
if(!is_undefined(code)) {
|
||||
q += chr(code);
|
||||
encoded = true;
|
||||
index += c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(q == "") {
|
||||
verb += string_char_at(input,index);
|
||||
index++;
|
||||
if(string_length(verb) == 255) {
|
||||
q = strict_encode_verb(verb);
|
||||
verb = "";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(verb != "") {
|
||||
q = strict_encode_verb(verb) + q;
|
||||
verb = "";
|
||||
}
|
||||
}
|
||||
|
||||
output += q;
|
||||
|
||||
}
|
||||
|
||||
if(verb != "") {
|
||||
output += strict_encode_verb(verb);
|
||||
}
|
||||
|
||||
return output;
|
||||
@ -0,0 +1,35 @@
|
||||
///strict_decompress(input)
|
||||
|
||||
/*
|
||||
Description: Returns a decompressed version of the provided input string
|
||||
Arguments: input (string)
|
||||
Returns: String
|
||||
*/
|
||||
|
||||
var input, input_size, output, index, ml, inv_dict;
|
||||
|
||||
input = argument0;
|
||||
input_size = string_length(input);
|
||||
output = "";
|
||||
index = 1;
|
||||
ml = _strict_data[? "max_length"];
|
||||
inv_dict = _strict_data[? "inv_dictionary"];
|
||||
|
||||
while(index <= input_size) {
|
||||
var char = string_ord_at(input,index);
|
||||
if(char == 255) {
|
||||
var n = string_ord_at(input,index+1);
|
||||
output += string_copy(input,index+2,n);
|
||||
index += n + 2;
|
||||
}
|
||||
else if(char == 254) {
|
||||
output += string_char_at(input,index+1);
|
||||
index += 2;
|
||||
}
|
||||
else {
|
||||
output += inv_dict[| char];
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
@ -0,0 +1,17 @@
|
||||
///strict_encode_verb(verb)
|
||||
|
||||
/*
|
||||
Description: (called from strict_compress). Returns an encoded verb ready to be added to a compressed output
|
||||
Arguments: verb (string)
|
||||
Returns: String
|
||||
*/
|
||||
|
||||
var verb = argument0;
|
||||
var verb_length = string_length(verb);
|
||||
|
||||
if(verb_length > 1) {
|
||||
return chr(255) + chr(verb_length) + verb;
|
||||
}
|
||||
else {
|
||||
return chr(254) + verb;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
///strict_init(data file)
|
||||
|
||||
/*
|
||||
Read dictionary file
|
||||
*/
|
||||
|
||||
globalvar _strict_data;
|
||||
|
||||
var json_data = "";
|
||||
|
||||
var f = file_text_open_read(argument0);
|
||||
while (!file_text_eof(f)) {
|
||||
json_data += file_text_read_string(f);
|
||||
file_text_readln(f);
|
||||
}
|
||||
file_text_close(f);
|
||||
|
||||
_strict_data = json_decode(json_data);
|
||||
@ -0,0 +1,262 @@
|
||||
/// update_variables
|
||||
switch(argument0){
|
||||
case "prev":
|
||||
global.itemPrev = array_clone(global.item);
|
||||
global.itemstakenPrev = global.itemstaken;
|
||||
global.metdeadPrev = array_clone(global.metdead);
|
||||
global.eventPrev = array_clone(global.event);
|
||||
global.monstersleftPrev = global.monstersleft;
|
||||
global.maxmissilesPrev = global.maxmissiles;
|
||||
global.maxsmissilesPrev = global.maxsmissiles;
|
||||
global.maxpbombsPrev = global.maxpbombs;
|
||||
global.maxhealthPrev = global.maxhealth;
|
||||
global.playerhealthPrev = global.playerhealth;
|
||||
global.morphballPrev = global.morphball;
|
||||
global.jumpballPrev = global.jumpball;
|
||||
global.powergripPrev = global.powergrip;
|
||||
global.spacejumpPrev = global.spacejump;
|
||||
global.screwattackPrev = global.screwattack;
|
||||
global.hijumpPrev = global.hijump;
|
||||
global.spiderballPrev = global.spiderball;
|
||||
global.speedboosterPrev = global.speedbooster;
|
||||
global.bombPrev = global.bomb;
|
||||
global.ibeamPrev = global.ibeam;
|
||||
global.wbeamPrev = global.wbeam;
|
||||
global.pbeamPrev = global.pbeam;
|
||||
global.sbeamPrev = global.sbeam;
|
||||
global.cbeamPrev = global.cbeam;
|
||||
global.missilesPrev = global.missiles;
|
||||
global.smissilesPrev = global.smissiles;
|
||||
global.pbombsPrev = global.pbombs;
|
||||
global.etanksPrev = global.etanks;
|
||||
global.mtanksPrev = global.mtanks;
|
||||
global.stanksPrev = global.stanks;
|
||||
global.ptanksPrev = global.ptanks;
|
||||
global.currentsuitPrev = global.currentsuit;
|
||||
global.monstersareaPrev = global.monstersarea;
|
||||
break;
|
||||
case "onlinevars":
|
||||
ds_grid_set(global.onlineList, 0, 0, global.itemPrev);
|
||||
ds_grid_set(global.onlineList, 1, 0, global.item);
|
||||
ds_grid_set(global.onlineList, 0, 1, global.metdeadPrev);
|
||||
ds_grid_set(global.onlineList, 1, 1, global.metdead);
|
||||
ds_grid_set(global.onlineList, 0, 2, global.itemstakenPrev);
|
||||
ds_grid_set(global.onlineList, 1, 2, global.itemstaken);
|
||||
ds_grid_set(global.onlineList, 0, 3, global.eventPrev);
|
||||
ds_grid_set(global.onlineList, 1, 3, global.event);
|
||||
ds_grid_set(global.onlineList, 0, 4, global.monstersleftPrev);
|
||||
ds_grid_set(global.onlineList, 1, 4, global.monstersleft);
|
||||
ds_grid_set(global.onlineList, 0, 5, global.maxmissilesPrev);
|
||||
ds_grid_set(global.onlineList, 1, 5, global.maxmissiles);
|
||||
ds_grid_set(global.onlineList, 0, 6, global.maxsmissilesPrev);
|
||||
ds_grid_set(global.onlineList, 1, 6, global.maxsmissiles);
|
||||
ds_grid_set(global.onlineList, 0, 7, global.maxpbombsPrev);
|
||||
ds_grid_set(global.onlineList, 1, 7, global.maxpbombs);
|
||||
ds_grid_set(global.onlineList, 0, 8, global.maxhealthPrev);
|
||||
ds_grid_set(global.onlineList, 1, 8, global.maxhealth);
|
||||
ds_grid_set(global.onlineList, 0, 9, global.playerhealthPrev);
|
||||
ds_grid_set(global.onlineList, 1, 9, global.playerhealth);
|
||||
ds_grid_set(global.onlineList, 0, 10, global.morphballPrev);
|
||||
ds_grid_set(global.onlineList, 1, 10, global.morphball);
|
||||
ds_grid_set(global.onlineList, 0, 11, global.jumpballPrev);
|
||||
ds_grid_set(global.onlineList, 1, 11, global.jumpball);
|
||||
ds_grid_set(global.onlineList, 0, 12, global.powergripPrev);
|
||||
ds_grid_set(global.onlineList, 1, 12, global.powergrip);
|
||||
ds_grid_set(global.onlineList, 0, 13, global.spacejumpPrev);
|
||||
ds_grid_set(global.onlineList, 1, 13, global.spacejump);
|
||||
ds_grid_set(global.onlineList, 0, 14, global.screwattackPrev);
|
||||
ds_grid_set(global.onlineList, 1, 14, global.screwattack);
|
||||
ds_grid_set(global.onlineList, 0, 15, global.hijumpPrev);
|
||||
ds_grid_set(global.onlineList, 1, 15, global.hijump);
|
||||
ds_grid_set(global.onlineList, 0, 16, global.spiderballPrev);
|
||||
ds_grid_set(global.onlineList, 1, 16, global.spiderball);
|
||||
ds_grid_set(global.onlineList, 0, 17, global.speedboosterPrev);
|
||||
ds_grid_set(global.onlineList, 1, 17, global.speedbooster);
|
||||
ds_grid_set(global.onlineList, 0, 18, global.bombPrev);
|
||||
ds_grid_set(global.onlineList, 1, 18, global.bomb);
|
||||
ds_grid_set(global.onlineList, 0, 19, global.ibeamPrev);
|
||||
ds_grid_set(global.onlineList, 1, 19, global.ibeam);
|
||||
ds_grid_set(global.onlineList, 0, 20, global.wbeamPrev);
|
||||
ds_grid_set(global.onlineList, 1, 20, global.wbeam);
|
||||
ds_grid_set(global.onlineList, 0, 21, global.pbeamPrev);
|
||||
ds_grid_set(global.onlineList, 1, 21, global.pbeam);
|
||||
ds_grid_set(global.onlineList, 0, 22, global.sbeamPrev);
|
||||
ds_grid_set(global.onlineList, 1, 22, global.sbeam);
|
||||
ds_grid_set(global.onlineList, 0, 23, global.cbeamPrev);
|
||||
ds_grid_set(global.onlineList, 1, 23, global.cbeam);
|
||||
ds_grid_set(global.onlineList, 0, 24, global.missilesPrev);
|
||||
ds_grid_set(global.onlineList, 1, 24, global.missiles);
|
||||
ds_grid_set(global.onlineList, 0, 25, global.smissilesPrev);
|
||||
ds_grid_set(global.onlineList, 1, 25, global.smissiles);
|
||||
ds_grid_set(global.onlineList, 0, 26, global.pbombsPrev);
|
||||
ds_grid_set(global.onlineList, 1, 26, global.pbombs);
|
||||
ds_grid_set(global.onlineList, 0, 27, global.etanksPrev);
|
||||
ds_grid_set(global.onlineList, 1, 27, global.etanks);
|
||||
ds_grid_set(global.onlineList, 0, 28, global.mtanksPrev);
|
||||
ds_grid_set(global.onlineList, 1, 28, global.mtanks);
|
||||
ds_grid_set(global.onlineList, 0, 29, global.stanksPrev);
|
||||
ds_grid_set(global.onlineList, 1, 29, global.stanks);
|
||||
ds_grid_set(global.onlineList, 0, 30, global.ptanksPrev);
|
||||
ds_grid_set(global.onlineList, 1, 30, global.ptanks);
|
||||
ds_grid_set(global.onlineList, 0, 31, global.currentsuitPrev);
|
||||
ds_grid_set(global.onlineList, 1, 31, global.currentsuit);
|
||||
ds_grid_set(global.onlineList, 0, 32, global.monstersareaPrev);
|
||||
ds_grid_set(global.onlineList, 1, 32, global.monstersarea);
|
||||
break;
|
||||
/*
|
||||
case "onlinevarscurrent":
|
||||
ds_grid_set(global.onlineList, 1, 0, global.item);
|
||||
ds_grid_set(global.onlineList, 1, 1, global.metdead);
|
||||
ds_grid_set(global.onlineList, 1, 2, global.itemstaken);
|
||||
ds_grid_set(global.onlineList, 1, 3, global.event);
|
||||
ds_grid_set(global.onlineList, 1, 4, global.monstersleft);
|
||||
ds_grid_set(global.onlineList, 1, 5, global.maxmissiles);
|
||||
ds_grid_set(global.onlineList, 1, 6, global.maxsmissiles);
|
||||
ds_grid_set(global.onlineList, 1, 7, global.maxpbombs);
|
||||
ds_grid_set(global.onlineList, 1, 8, global.maxhealth);
|
||||
ds_grid_set(global.onlineList, 1, 9, global.playerhealth);
|
||||
ds_grid_set(global.onlineList, 1, 10, global.morphball);
|
||||
ds_grid_set(global.onlineList, 1, 11, global.jumpball);
|
||||
ds_grid_set(global.onlineList, 1, 12, global.powergrip);
|
||||
ds_grid_set(global.onlineList, 1, 13, global.spacejump);
|
||||
ds_grid_set(global.onlineList, 1, 14, global.screwattack);
|
||||
ds_grid_set(global.onlineList, 1, 15, global.hijump);
|
||||
ds_grid_set(global.onlineList, 1, 16, global.spiderball);
|
||||
ds_grid_set(global.onlineList, 1, 17, global.speedbooster);
|
||||
ds_grid_set(global.onlineList, 1, 18, global.bomb);
|
||||
ds_grid_set(global.onlineList, 1, 19, global.ibeam);
|
||||
ds_grid_set(global.onlineList, 1, 20, global.wbeam);
|
||||
ds_grid_set(global.onlineList, 1, 21, global.pbeam);
|
||||
ds_grid_set(global.onlineList, 1, 22, global.sbeam);
|
||||
ds_grid_set(global.onlineList, 1, 23, global.cbeam);
|
||||
ds_grid_set(global.onlineList, 1, 24, global.missiles);
|
||||
ds_grid_set(global.onlineList, 1, 25, global.smissiles);
|
||||
ds_grid_set(global.onlineList, 1, 26, global.pbombs);
|
||||
ds_grid_set(global.onlineList, 1, 27, global.etanks);
|
||||
ds_grid_set(global.onlineList, 1, 28, global.mtanks);
|
||||
ds_grid_set(global.onlineList, 1, 29, global.stanks);
|
||||
ds_grid_set(global.onlineList, 1, 30, global.ptanks);
|
||||
ds_grid_set(global.onlineList, 1, 31, global.currentsuit);
|
||||
ds_grid_set(global.onlineList, 1, 32, global.monstersarea);
|
||||
break;
|
||||
case "onlinevarsprev":
|
||||
ds_grid_set(global.onlineList, 0, 0, global.itemPrev);
|
||||
ds_grid_set(global.onlineList, 0, 1, global.metdeadPrev);
|
||||
ds_grid_set(global.onlineList, 0, 2, global.itemstakenPrev);
|
||||
ds_grid_set(global.onlineList, 0, 3, global.eventPrev);
|
||||
ds_grid_set(global.onlineList, 0, 4, global.monstersleftPrev);
|
||||
ds_grid_set(global.onlineList, 0, 5, global.maxmissilesPrev);
|
||||
ds_grid_set(global.onlineList, 0, 6, global.maxsmissilesPrev);
|
||||
ds_grid_set(global.onlineList, 0, 7, global.maxpbombsPrev);
|
||||
ds_grid_set(global.onlineList, 0, 8, global.maxhealthPrev);
|
||||
ds_grid_set(global.onlineList, 0, 9, global.playerhealthPrev);
|
||||
ds_grid_set(global.onlineList, 0, 10, global.morphballPrev);
|
||||
ds_grid_set(global.onlineList, 0, 11, global.jumpballPrev);
|
||||
ds_grid_set(global.onlineList, 0, 12, global.powergripPrev);
|
||||
ds_grid_set(global.onlineList, 0, 13, global.spacejumpPrev);
|
||||
ds_grid_set(global.onlineList, 0, 14, global.screwattackPrev);
|
||||
ds_grid_set(global.onlineList, 0, 15, global.hijumpPrev);
|
||||
ds_grid_set(global.onlineList, 0, 16, global.spiderballPrev);
|
||||
ds_grid_set(global.onlineList, 0, 17, global.speedboosterPrev);
|
||||
ds_grid_set(global.onlineList, 0, 18, global.bombPrev);
|
||||
ds_grid_set(global.onlineList, 0, 19, global.ibeamPrev);
|
||||
ds_grid_set(global.onlineList, 0, 20, global.wbeamPrev);
|
||||
ds_grid_set(global.onlineList, 0, 21, global.pbeamPrev);
|
||||
ds_grid_set(global.onlineList, 0, 22, global.sbeamPrev);
|
||||
ds_grid_set(global.onlineList, 0, 23, global.cbeamPrev);
|
||||
ds_grid_set(global.onlineList, 0, 24, global.missilesPrev);
|
||||
ds_grid_set(global.onlineList, 0, 25, global.smissilesPrev);
|
||||
ds_grid_set(global.onlineList, 0, 26, global.pbombsPrev);
|
||||
ds_grid_set(global.onlineList, 0, 27, global.etanksPrev);
|
||||
ds_grid_set(global.onlineList, 0, 28, global.mtanksPrev);
|
||||
ds_grid_set(global.onlineList, 0, 29, global.stanksPrev);
|
||||
ds_grid_set(global.onlineList, 0, 30, global.ptanksPrev);
|
||||
ds_grid_set(global.onlineList, 0, 31, global.currentsuitPrev);
|
||||
ds_grid_set(global.onlineList, 0, 32, global.monstersareaPrev);
|
||||
break;
|
||||
*/
|
||||
case "replaceglobalvars":
|
||||
global.item = ds_grid_get(global.onlineList, 1, 0);
|
||||
global.metdead = ds_grid_get(global.onlineList, 1, 1);
|
||||
global.itemstaken = ds_grid_get(global.onlineList, 1, 2);
|
||||
global.event = ds_grid_get(global.onlineList, 1, 3);
|
||||
global.monstersleft = ds_grid_get(global.onlineList, 1, 4);
|
||||
global.maxmissiles = ds_grid_get(global.onlineList, 1, 5);
|
||||
global.maxsmissiles = ds_grid_get(global.onlineList, 1, 6);
|
||||
global.maxpbombs = ds_grid_get(global.onlineList, 1, 7);
|
||||
global.maxhealth = ds_grid_get(global.onlineList, 1, 8);
|
||||
global.playerhealth = ds_grid_get(global.onlineList, 1, 9);
|
||||
global.morphball = ds_grid_get(global.onlineList, 1, 10);
|
||||
global.jumpball = ds_grid_get(global.onlineList, 1, 11);
|
||||
global.powergrip = ds_grid_get(global.onlineList, 1, 12);
|
||||
global.spacejump = ds_grid_get(global.onlineList, 1, 13);
|
||||
global.screwattack = ds_grid_get(global.onlineList, 1, 14);
|
||||
global.hijump = ds_grid_get(global.onlineList, 1, 15);
|
||||
global.spiderball = ds_grid_get(global.onlineList, 1, 16);
|
||||
global.speedbooster = ds_grid_get(global.onlineList, 1, 17);
|
||||
global.bomb = ds_grid_get(global.onlineList, 1, 18);
|
||||
global.ibeam = ds_grid_get(global.onlineList, 1, 19);
|
||||
global.wbeam = ds_grid_get(global.onlineList, 1, 20);
|
||||
global.pbeam = ds_grid_get(global.onlineList, 1, 21);
|
||||
global.sbeam = ds_grid_get(global.onlineList, 1, 22);
|
||||
global.cbeam = ds_grid_get(global.onlineList, 1, 23);
|
||||
global.missiles = ds_grid_get(global.onlineList, 1, 24);
|
||||
global.smissiles = ds_grid_get(global.onlineList, 1, 25);
|
||||
global.pbombs = ds_grid_get(global.onlineList, 1, 26);
|
||||
global.etanks = ds_grid_get(global.onlineList, 1, 27);
|
||||
global.mtanks = ds_grid_get(global.onlineList, 1, 28);
|
||||
global.stanks = ds_grid_get(global.onlineList, 1, 29);
|
||||
global.ptanks = ds_grid_get(global.onlineList, 1, 30);
|
||||
global.currentsuit = ds_grid_get(global.onlineList, 1, 31);
|
||||
global.monstersarea = ds_grid_get(global.onlineList, 1, 32);
|
||||
break;
|
||||
case "disablesame":
|
||||
for(var i=0; i<ds_grid_height(global.onlineSend); i++){
|
||||
if(global.onlineSend[# 2, i] != 0){
|
||||
global.onlineList[# 1, i] = global.onlineSend[# 1, i];
|
||||
}
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case "item":
|
||||
show_debug_message("item");
|
||||
for(var i=0; i<array_length_1d(global.item); i++){
|
||||
show_debug_message(string(global.itemPrev[i]) + " " + string(global.item[i]));
|
||||
if(global.itemPrev[i] != global.item[i]){
|
||||
global.onlineSend[# 0, 0] = global.onlineList[# 0, 0];
|
||||
global.onlineSend[# 1, 0] = global.onlineList[# 1, 0];
|
||||
global.onlineSend[# 2, 0] = global.onlineList[# 2, 0];
|
||||
show_debug_message("item changed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "event":
|
||||
show_debug_message("event");
|
||||
for(var i=0; i<array_length_1d(global.event); i++){
|
||||
show_debug_message(string(global.eventPrev[i]) + " " + string(global.event[i]));
|
||||
if(global.eventPrev[i] != global.event[i]){
|
||||
global.onlineSend[# 0, 3] = global.onlineList[# 0, 3];
|
||||
global.onlineSend[# 1, 3] = global.onlineList[# 1, 3];
|
||||
global.onlineSend[# 2, 3] = global.onlineList[# 2, 3];
|
||||
show_debug_message("event changed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "metdead":
|
||||
show_debug_message("metdead");
|
||||
for(var i=0; i<array_length_1d(global.metdead); i++){
|
||||
show_debug_message(string(global.metdeadPrev[i]) + " " + string(global.metdead[i]));
|
||||
if(global.metdeadPrev[i] != global.metdead[i]){
|
||||
global.onlineSend[# 0, 1] = global.onlineList[# 0, 1];
|
||||
global.onlineSend[# 1, 1] = global.onlineList[# 1, 1];
|
||||
global.onlineSend[# 2, 1] = global.onlineList[# 2, 1];
|
||||
show_debug_message("metdead changed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue