├── .import └── icon.png-487276ed1e3a0c39cad0279d744ee560.stex ├── F25_Bank_Printer.ttf ├── LineEdit.gd ├── ServerListing.gd ├── VCR_OSD_MONO_1.001.ttf ├── account.gd ├── console.gd ├── default_env.tres ├── editor.gd ├── export_presets.cfg ├── filesystem ├── console.rc ├── logfile └── test.z ├── grid.gd ├── http.gd ├── http.tscn ├── icon.png ├── icon.png.import ├── installer.gd ├── lobby.gd ├── lobby.tscn ├── main.gd ├── main.tscn ├── network.gd ├── player.gd ├── player.tscn ├── project.godot ├── readme.md ├── server.gd ├── server.tscn ├── test.exe └── test.pck /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex -------------------------------------------------------------------------------- /F25_Bank_Printer.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/F25_Bank_Printer.ttf -------------------------------------------------------------------------------- /LineEdit.gd: -------------------------------------------------------------------------------- 1 | extends LineEdit 2 | 3 | var Http = load("res://http.tscn") 4 | 5 | func _ready(): 6 | var http = get_node("../../../HTTPRequest") 7 | http.request("http://zerosploit-api.herokuapp.com/ips.json") 8 | var instance = Http.instance() 9 | self.add_child(instance) 10 | get_node("../LineEdit/HTTPRequest").get("servers.json", self) 11 | 12 | func handle_results(results): 13 | for server in results: 14 | self.text = server.ip 15 | -------------------------------------------------------------------------------- /ServerListing.gd: -------------------------------------------------------------------------------- 1 | extends TextEdit 2 | 3 | var Http = load("res://http.tscn") 4 | 5 | var list_timer = Timer.new() 6 | 7 | func _ready(): 8 | list_timer.set_wait_time(1) 9 | list_timer.connect("timeout", self, "_on_list_timer_timeout") 10 | add_child(list_timer) 11 | list_timer.start() 12 | var instance = Http.instance() 13 | self.add_child(instance) 14 | 15 | func _on_list_timer_timeout(): 16 | get_node("HTTPRequest").get("servers.json", self) 17 | 18 | func handle_results(results): 19 | for server in results: 20 | var text = "" 21 | insert_text_at_cursor(str(server.ip, "\n")) 22 | 23 | -------------------------------------------------------------------------------- /VCR_OSD_MONO_1.001.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/VCR_OSD_MONO_1.001.ttf -------------------------------------------------------------------------------- /account.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var cmd = "" 4 | var login = "" 5 | var password = "" 6 | var password_confirmation = "" 7 | var current_index = 0 8 | 9 | func _ready(): 10 | pass 11 | 12 | func _input(event): 13 | var root = get_parent() 14 | var console = root.get_node('console') 15 | 16 | if Input.is_key_pressed(KEY_ENTER): 17 | console.insert_text_at_cursor("\n") 18 | 19 | cmd = cmd.replace('Enter', '') 20 | 21 | if current_index == 1: 22 | login = cmd 23 | console.insert_text_at_cursor('password: ') 24 | elif current_index == 2: 25 | password = cmd 26 | console.insert_text_at_cursor('password_confirmation: ') 27 | elif current_index == 3: 28 | password_confirmation = cmd 29 | 30 | var http = HTTPClient.new() 31 | var err = http.connect_to_host("zerosploit-api.herokuapp.com", 80) 32 | assert(err == OK) 33 | 34 | while http.get_status() == HTTPClient.STATUS_CONNECTING or http.get_status() == HTTPClient.STATUS_RESOLVING: 35 | http.poll() 36 | print("Connecting..") 37 | OS.delay_msec(500) 38 | 39 | assert(http.get_status() == HTTPClient.STATUS_CONNECTED) 40 | 41 | # var body = http.query_string_from_dict({ 42 | # 'user': { 43 | # 'handle': login, 44 | # 'password': password, 45 | # 'password_confirmation': password_confirmation 46 | # } 47 | # }) 48 | var body = str("user[handle]=", login, "&user[password]=", password, "&user[password_confirmation]=", password_confirmation) 49 | 50 | http.request( 51 | HTTPClient.METHOD_POST, 52 | '/users.json', 53 | ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(body.length())], 54 | body 55 | ) 56 | 57 | cmd = "" 58 | current_index += 1 59 | 60 | elif !event.is_pressed() and !event.is_class("InputEventMouseMotion"): 61 | cmd += event.as_text() 62 | 63 | 64 | func login(): 65 | get_tree().set_input_as_handled() 66 | var root = get_parent() 67 | var console = root.get_node('console') 68 | 69 | console.insert_text_at_cursor('handle: ') -------------------------------------------------------------------------------- /console.gd: -------------------------------------------------------------------------------- 1 | extends TextEdit 2 | 3 | var shown = false 4 | var editing = false 5 | var cmd = "" 6 | var lex = "" 7 | var pbuf = false 8 | var tokens = [] 9 | var AST = [] 10 | var keywords = [ 11 | 'QUIT', 12 | 'BUILD', 13 | 'PROGRAM', 14 | 'END PROGRAM', 15 | 'SCAN', 16 | 'ECHO', 17 | 'CONFIG', 18 | 'INSTALL', 19 | 'LIST', 20 | 'EDIT', 21 | 'LOGIN' 22 | ] 23 | 24 | func _ready(): 25 | var init = load_file('console.rc').split("\n") 26 | 27 | for i in init: 28 | lexer(i.to_upper() + "\n") 29 | 30 | insert_text_at_cursor(">") 31 | 32 | func _input(event): 33 | if editing == false: 34 | if Input.is_key_pressed(KEY_ENTER): 35 | cmd += "\n" 36 | get_tree().set_input_as_handled() 37 | insert_text_at_cursor(">") 38 | write_log(cmd) 39 | lexer(cmd.to_upper()) 40 | cmd = "" 41 | elif !event.is_pressed() and !event.is_class("InputEventMouseMotion"): 42 | var e = event.as_text() 43 | 44 | if e == 'Space': 45 | cmd += ' ' 46 | elif e == 'BackSpace': 47 | cmd = cmd.left(len(cmd) - 1) 48 | elif e == 'Enter' or e == 'Down' or e == 'Up' or e == 'Left' or e == 'Right': 49 | pass 50 | elif e == 'Escape': 51 | hide() 52 | shown = false 53 | elif e == 'Tab': 54 | get_tree().set_input_as_handled() 55 | tab_complete() 56 | else: 57 | cmd += event.as_text() 58 | 59 | func lexer(input): 60 | lex = "" 61 | 62 | for words in input.split(' '): 63 | for i in words: 64 | lex += i 65 | print(lex) 66 | 67 | if lex in keywords: 68 | if lex == 'PROGRAM': 69 | pbuf = true 70 | lex = "" 71 | print("Program buffer started...") 72 | elif lex == 'END PROGRAM': 73 | pbuf = false 74 | lex = "" 75 | print("Program buffer ended.") 76 | else: 77 | tokens.append({'id': 'keyword', 'value': lex}) 78 | lex = "" 79 | else: 80 | if lex.right(len(lex) - 1) == "\n": 81 | tokens.append({'id': 'argument', 'value': lex.left(len(lex) - 1)}) 82 | lex = "" 83 | 84 | if pbuf == false: 85 | parser() 86 | 87 | func parser(): 88 | print("TOKENS: ", tokens) 89 | 90 | var cur_node = "" 91 | 92 | for token in tokens: 93 | if token['id'] == 'keyword': 94 | var val = token['value'] 95 | cur_node = val 96 | 97 | AST.append({val: []}) 98 | elif token['id'] == 'argument': 99 | add_ast_node(cur_node, token['value']) 100 | 101 | run() 102 | 103 | func add_ast_node(parent, node): 104 | for a in AST: 105 | if parent in a: 106 | a[parent].append(node) 107 | 108 | func run(ast=AST): 109 | print("AST: ", ast) 110 | 111 | for a in ast: 112 | if typeof(a) == TYPE_DICTIONARY: 113 | for k in a: 114 | call(k.to_lower(), PoolStringArray(a[k]).join(', ').to_lower()) 115 | elif typeof(a) == TYPE_ARRAY: 116 | print("DEBUG AST ARRAY: ", a) 117 | else: 118 | call(a.to_lower()) 119 | 120 | tokens = [] 121 | AST = [] 122 | 123 | func write_log(string): 124 | var time = OS.get_time() 125 | var hour = time.hour 126 | var minute = time.minute 127 | var second = time.second 128 | var date = OS.get_date() 129 | var day = date.day 130 | var month = date.month 131 | var year = date.year 132 | var file = File.new() 133 | 134 | file.open('res://filesystem/logfile', file.READ_WRITE) 135 | file.seek_end() 136 | file.store_string(str( 137 | '[', year, '/', month, '/', day, ' @ ', hour, ':', minute, ':', second, '] ', string, "\n" 138 | )) 139 | file.close() 140 | 141 | func echo(string): 142 | write_log(str(string)) 143 | 144 | if editing == false: 145 | insert_text_at_cursor(str("\n", string, "\n")) 146 | 147 | func tab_complete(): 148 | var files = read_dir("") 149 | 150 | for file in files: 151 | if cmd.to_lower() == file.left(len(cmd)): 152 | cmd += file.right(len(cmd)).to_upper() 153 | insert_text_at_cursor(cmd.to_lower()) 154 | 155 | func read_dir(target): 156 | var files = [] 157 | var dir = Directory.new() 158 | dir.open(str("filesystem/", target)) 159 | dir.list_dir_begin() 160 | 161 | while true: 162 | var file = dir.get_next() 163 | 164 | if file == "": 165 | break 166 | elif not file.begins_with("."): 167 | files.append(file) 168 | 169 | dir.list_dir_end() 170 | 171 | return files 172 | 173 | func list(target): 174 | var files = read_dir(target) 175 | echo(files) 176 | 177 | func load_file(filename): 178 | var file = File.new() 179 | var content = "" 180 | 181 | print("FILE DEBUG: ", filename.replace("period", ".")) 182 | file.open(str('res://filesystem/', filename.replace("period", ".")), file.READ) 183 | content = file.get_as_text() 184 | file.close() 185 | 186 | return content 187 | 188 | func edit(filename): 189 | var root = get_parent() 190 | var editor = root.get_node('editor') 191 | var content = load_file(filename) 192 | 193 | editing = true 194 | 195 | func login(tmp): 196 | var root = get_parent() 197 | var account = root.get_node('account') 198 | account.login() 199 | 200 | func install(package): 201 | var root = get_parent() 202 | var installer = root.get_node('installer') 203 | 204 | installer.call(package) 205 | 206 | func build(type): 207 | var root = get_parent() 208 | var camera = root.get_node('player') 209 | var server = load(str('res://', type, '.tscn')) 210 | 211 | if server == null: 212 | echo("resource not found!") 213 | else: 214 | var instance = server.instance() 215 | 216 | if root.money - instance.price >= 0: 217 | var trans = camera.get_global_transform().origin - Vector3(0, 0, 5) 218 | 219 | instance.set_translation(trans) 220 | root.call_deferred('add_child', instance) 221 | root.players.append(instance) 222 | 223 | print('Built a server!') 224 | else: 225 | echo("Insufficient funds!") 226 | 227 | func config(server): 228 | var root = get_parent() 229 | var players = root.players 230 | 231 | for p in players: 232 | if PoolStringArray(p.ip) == server.split('period'): 233 | p.config() 234 | 235 | func scan(): 236 | var root = get_parent() 237 | var players = root.players 238 | 239 | for p in players: 240 | print(p.ping(), ' from ', PoolStringArray(p.ip).join('.')) 241 | 242 | func quit(return_code): 243 | get_tree().quit() 244 | -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | radiance_size = 4 6 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 7 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 8 | sky_curve = 0.25 9 | sky_energy = 1.0 10 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 11 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 12 | ground_curve = 0.01 13 | ground_energy = 1.0 14 | sun_color = Color( 1, 1, 1, 1 ) 15 | sun_latitude = 35.0 16 | sun_longitude = 0.0 17 | sun_angle_min = 1.0 18 | sun_angle_max = 100.0 19 | sun_curve = 0.05 20 | sun_energy = 16.0 21 | texture_size = 2 22 | 23 | [resource] 24 | 25 | background_mode = 2 26 | background_sky = SubResource( 1 ) 27 | background_sky_custom_fov = 0.0 28 | background_color = Color( 0, 0, 0, 1 ) 29 | background_energy = 1.0 30 | background_canvas_max_layer = 0 31 | ambient_light_color = Color( 0, 0, 0, 1 ) 32 | ambient_light_energy = 1.0 33 | ambient_light_sky_contribution = 1.0 34 | fog_enabled = false 35 | fog_color = Color( 0.5, 0.6, 0.7, 1 ) 36 | fog_sun_color = Color( 1, 0.9, 0.7, 1 ) 37 | fog_sun_amount = 0.0 38 | fog_depth_enabled = true 39 | fog_depth_begin = 10.0 40 | fog_depth_curve = 1.0 41 | fog_transmit_enabled = false 42 | fog_transmit_curve = 1.0 43 | fog_height_enabled = false 44 | fog_height_min = 0.0 45 | fog_height_max = 100.0 46 | fog_height_curve = 1.0 47 | tonemap_mode = 0 48 | tonemap_exposure = 1.0 49 | tonemap_white = 1.0 50 | auto_exposure_enabled = false 51 | auto_exposure_scale = 0.4 52 | auto_exposure_min_luma = 0.05 53 | auto_exposure_max_luma = 8.0 54 | auto_exposure_speed = 0.5 55 | ss_reflections_enabled = false 56 | ss_reflections_max_steps = 64 57 | ss_reflections_fade_in = 0.15 58 | ss_reflections_fade_out = 2.0 59 | ss_reflections_depth_tolerance = 0.2 60 | ss_reflections_roughness = true 61 | ssao_enabled = false 62 | ssao_radius = 1.0 63 | ssao_intensity = 1.0 64 | ssao_radius2 = 0.0 65 | ssao_intensity2 = 1.0 66 | ssao_bias = 0.01 67 | ssao_light_affect = 0.0 68 | ssao_color = Color( 0, 0, 0, 1 ) 69 | ssao_quality = 0 70 | ssao_blur = 3 71 | ssao_edge_sharpness = 4.0 72 | dof_blur_far_enabled = false 73 | dof_blur_far_distance = 10.0 74 | dof_blur_far_transition = 5.0 75 | dof_blur_far_amount = 0.1 76 | dof_blur_far_quality = 1 77 | dof_blur_near_enabled = false 78 | dof_blur_near_distance = 2.0 79 | dof_blur_near_transition = 1.0 80 | dof_blur_near_amount = 0.1 81 | dof_blur_near_quality = 1 82 | glow_enabled = false 83 | glow_levels/1 = false 84 | glow_levels/2 = false 85 | glow_levels/3 = true 86 | glow_levels/4 = false 87 | glow_levels/5 = true 88 | glow_levels/6 = false 89 | glow_levels/7 = false 90 | glow_intensity = 0.8 91 | glow_strength = 1.0 92 | glow_bloom = 0.0 93 | glow_blend_mode = 2 94 | glow_hdr_threshold = 1.0 95 | glow_hdr_scale = 2.0 96 | glow_bicubic_upscale = false 97 | adjustment_enabled = false 98 | adjustment_brightness = 1.0 99 | adjustment_contrast = 1.0 100 | adjustment_saturation = 1.0 101 | 102 | -------------------------------------------------------------------------------- /editor.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var f_name = "" 4 | var saving = false 5 | var save_buf = "" 6 | 7 | func _ready(): 8 | pass 9 | 10 | func _input(event): 11 | if saving == false: 12 | if Input.is_key_pressed(KEY_ESCAPE): 13 | ask_save() 14 | else: 15 | if Input.is_key_pressed(KEY_Y): 16 | save_file() 17 | 18 | func edit(content, fname): 19 | var root = get_parent() 20 | var console = root.get_node('console') 21 | f_name = fname 22 | 23 | for keyword in console.keywords: 24 | console.add_keyword_color(keyword.to_lower(), Color(0, 255, 0)) 25 | 26 | console.caret_blink = true 27 | console.show_line_numbers = true 28 | console.syntax_highlighting = true 29 | console.text = content 30 | 31 | func ask_save(): 32 | var root = get_parent() 33 | var console = root.get_node('console') 34 | save_buf = console.text 35 | saving = true 36 | 37 | console.insert_text_at_cursor("\nSave this file? (Y/n): ") 38 | 39 | func save_file(): 40 | var root = get_parent() 41 | var console = root.get_node('console') 42 | var file = File.new() 43 | 44 | console.text = '' 45 | console.show_line_numbers = false 46 | console.syntax_highlighting = false 47 | 48 | file.open(str('res://filesystem/', f_name.replace('period', '.')), file.WRITE) 49 | file.store_string(save_buf) 50 | file.close() 51 | -------------------------------------------------------------------------------- /export_presets.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Windows Desktop" 4 | platform="Windows Desktop" 5 | runnable=true 6 | custom_features="" 7 | export_filter="all_resources" 8 | include_filter="" 9 | exclude_filter="" 10 | patch_list=PoolStringArray( ) 11 | 12 | [preset.0.options] 13 | 14 | texture_format/s3tc=true 15 | texture_format/etc=false 16 | texture_format/etc2=false 17 | binary_format/64_bits=true 18 | custom_template/release="" 19 | custom_template/debug="" 20 | application/icon="" 21 | application/file_version="" 22 | application/product_version="" 23 | application/company_name="" 24 | application/product_name="" 25 | application/file_description="" 26 | application/copyright="" 27 | application/trademarks="" 28 | -------------------------------------------------------------------------------- /filesystem/console.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/filesystem/console.rc -------------------------------------------------------------------------------- /filesystem/logfile: -------------------------------------------------------------------------------- 1 | 2 | Installing portscan... 3 | 4 | server instantiated: [40, 211, 75, 64] 5 | 6 | Downloading... 7 | 8 | Configuring... 9 | 10 | Compiling... 11 | 12 | Installed! 13 | BUILD SERVER 14 | 15 | server instantiated: [10, 72, 46, 22] 16 | [12:40:38] Installing portscan... 17 | [12:40:38] server instantiated: [56, 187, 237, 225] 18 | [12:40:39] Downloading... 19 | [12:40:40] Configuring... 20 | [12:40:41] Compiling... 21 | [12:40:42] Installed! 22 | [12:40:45] BUILD SERVER 23 | 24 | [12:40:45] server instantiated: [70, 91, 228, 21] 25 | [2018/2/21 @ 12:44:12] Installing portscan... 26 | [2018/2/21 @ 12:44:12] server instantiated: [114, 93, 32, 142] 27 | [2018/2/21 @ 12:44:13] Downloading... 28 | [2018/2/21 @ 12:44:14] Configuring... 29 | [2018/2/21 @ 12:44:15] Compiling... 30 | [2018/2/21 @ 12:44:16] Installed! 31 | [2018/2/21 @ 12:44:19] BUILD SERVER 32 | 33 | [2018/2/21 @ 12:44:19] server instantiated: [207, 188, 109, 221] 34 | [2018/2/21 @ 12:44:50] Installing portscan... 35 | [2018/2/21 @ 12:44:50] server instantiated: [32, 244, 230, 7] 36 | [2018/2/21 @ 12:44:51] Downloading... 37 | [2018/2/21 @ 12:44:52] Configuring... 38 | [2018/2/21 @ 12:44:53] Compiling... 39 | [2018/2/21 @ 12:44:54] Installed! 40 | [2018/2/21 @ 12:44:59] EDIT LOGFILE 41 | 42 | [2018/2/21 @ 12:44:59] 43 | Installing portscan... 44 | 45 | server instantiated: [40, 211, 75, 64] 46 | 47 | Downloading... 48 | 49 | Configuring... 50 | 51 | Compiling... 52 | 53 | Installed! 54 | BUILD SERVER 55 | 56 | server instantiated: [10, 72, 46, 22] 57 | [12:40:38] Installing portscan... 58 | [12:40:38] server instantiated: [56, 187, 237, 225] 59 | [12:40:39] Downloading... 60 | [12:40:40] Configuring... 61 | [12:40:41] Compiling... 62 | [12:40:42] Installed! 63 | [12:40:45] BUILD SERVER 64 | 65 | [12:40:45] server instantiated: [70, 91, 228, 21] 66 | [2018/2/21 @ 12:44:12] Installing portscan... 67 | [2018/2/21 @ 12:44:12] server instantiated: [114, 93, 32, 142] 68 | [2018/2/21 @ 12:44:13] Downloading... 69 | [2018/2/21 @ 12:44:14] Configuring... 70 | [2018/2/21 @ 12:44:15] Compiling... 71 | [2018/2/21 @ 12:44:16] Installed! 72 | [2018/2/21 @ 12:44:19] BUILD SERVER 73 | 74 | [2018/2/21 @ 12:44:19] server instantiated: [207, 188, 109, 221] 75 | [2018/2/21 @ 12:44:50] Installing portscan... 76 | [2018/2/21 @ 12:44:50] server instantiated: [32, 244, 230, 7] 77 | [2018/2/21 @ 12:44:51] Downloading... 78 | [2018/2/21 @ 12:44:52] Configuring... 79 | [2018/2/21 @ 12:44:53] Compiling... 80 | [2018/2/21 @ 12:44:54] Installed! 81 | [2018/2/21 @ 12:44:59] EDIT LOGFILE 82 | 83 | 84 | [2018/2/21 @ 13:53:55] Installing portscan... 85 | [2018/2/21 @ 13:53:55] server instantiated: [153, 93, 171, 23] 86 | [2018/2/21 @ 13:53:56] Downloading... 87 | [2018/2/21 @ 13:53:57] Configuring... 88 | [2018/2/21 @ 13:53:58] Compiling... 89 | [2018/2/21 @ 13:53:59] Installed! 90 | [2018/2/21 @ 13:54:4] EDIT CONSOLEPeriodRC 91 | 92 | [2018/2/21 @ 13:54:4] build server 93 | install portscan 94 | 95 | [2018/2/21 @ 13:55:52] EDIT CONSOLEPeriodRC 96 | 97 | [2018/2/21 @ 13:55:52] 98 | Save this file? (Y/n): 99 | [2018/2/21 @ 13:57:27] Installing portscan... 100 | [2018/2/21 @ 13:57:27] server instantiated: [64, 214, 53, 71] 101 | [2018/2/21 @ 13:57:28] Downloading... 102 | [2018/2/21 @ 13:57:29] Configuring... 103 | [2018/2/21 @ 13:57:30] Compiling... 104 | [2018/2/21 @ 13:57:31] Installed! 105 | [2018/2/21 @ 13:57:41] EDIT CONSOLEPeriodRC 106 | 107 | [2018/2/21 @ 13:57:41] build server 108 | install portscan 109 | 110 | Save this file? (Y/n): 111 | [2018/2/21 @ 14:2:12] server instantiated: [208, 74, 138, 101] 112 | [2018/2/21 @ 14:2:24] EDIT CONSOLEPeriodRC 113 | 114 | [2018/2/21 @ 16:29:54] Installing portscan... 115 | [2018/2/21 @ 16:29:54] server instantiated: [68, 161, 210, 139] 116 | [2018/2/21 @ 16:29:55] Downloading... 117 | [2018/2/21 @ 16:29:56] Configuring... 118 | [2018/2/21 @ 16:29:57] Compiling... 119 | [2018/2/21 @ 16:29:58] Installed! 120 | [2018/2/21 @ 16:30:3] EDIT TESTPeriodTXT 121 | 122 | [2018/2/21 @ 16:35:17] EDIT TESTPeriodTXT 123 | 124 | [2018/2/21 @ 16:35:54] EDIT TESTINGPeriodTXT 125 | 126 | [2018/2/21 @ 16:41:59] BUILD SERVER 127 | 128 | [2018/2/21 @ 16:42:21] BUILD SERVER 129 | 130 | [2018/2/21 @ 16:42:21] server instantiated: [249, 87, 213, 43] 131 | [2018/2/22 @ 1:1:49] AltAltBUILD SERVER 132 | 133 | [2018/2/22 @ 1:1:52] BUILD SERVER 134 | 135 | [2018/2/22 @ 1:1:52] server instantiated: [250, 84, 59, 149] 136 | [2018/2/22 @ 5:20:46] PageDownPageDownPageUpBUILD SERVER 137 | 138 | [2018/2/22 @ 5:20:50] BUILD SERVER 139 | 140 | [2018/3/4 @ 13:58:1] EDIT CONSOLEPeriodRC 141 | 142 | [2018/3/4 @ 14:6:19] EDIT CONSOLEPeriodRC 143 | 144 | [2018/3/4 @ 14:11:20] BUILD EDIT CONSOLEPeriodRC 145 | 146 | [2018/3/4 @ 14:11:20] resource not found! 147 | [2018/3/4 @ 14:18:1] EDIT CONSOLEPeriodRC 148 | 149 | [2018/3/5 @ 20:16:51] LOGIN TMP 150 | 151 | [2018/3/5 @ 20:17:4] LOGIN TMP 152 | 153 | [2018/3/5 @ 20:17:8] TEST 154 | 155 | [2018/3/7 @ 11:55:24] LOGIN TMP 156 | 157 | [2018/3/7 @ 11:55:27] TEST1 158 | 159 | [2018/3/7 @ 11:56:56] LOGIN TMP 160 | 161 | [2018/3/7 @ 11:57:54] LOGIN TMP 162 | 163 | [2018/3/7 @ 11:58:14] LOGIN TMP 164 | 165 | [2018/3/7 @ 11:58:17] TEST 166 | 167 | [2018/3/7 @ 11:58:19] TESTTEST 168 | 169 | [2018/3/7 @ 12:8:37] LOGIN TMP 170 | 171 | [2018/3/7 @ 12:8:39] TEST1 172 | 173 | [2018/3/7 @ 12:8:41] TESTTEST 174 | 175 | [2018/3/7 @ 12:10:4] LOGIN TMP 176 | 177 | [2018/3/7 @ 12:10:6] TEST 178 | 179 | [2018/3/7 @ 12:10:8] TESTTEST 180 | 181 | [2018/3/7 @ 12:10:42] LOGIN TMP 182 | 183 | [2018/3/7 @ 12:10:45] TEST 184 | 185 | [2018/3/7 @ 12:10:47] TESTTEST 186 | 187 | [2018/3/7 @ 12:11:48] LOGIN TMP 188 | 189 | [2018/3/7 @ 12:11:50] TEST 190 | 191 | [2018/3/7 @ 12:11:52] TESTTEST 192 | 193 | [2018/3/7 @ 12:12:17] LOGIN TMP 194 | 195 | [2018/3/7 @ 12:12:20] TEST 196 | 197 | [2018/3/7 @ 12:12:22] TESTTEST 198 | 199 | [2018/3/7 @ 12:12:45] LOGIN TMP 200 | 201 | [2018/3/7 @ 12:12:46] TEST 202 | 203 | [2018/3/7 @ 12:12:48] TESTTEST 204 | 205 | [2018/3/7 @ 12:13:18] LOGIN TMP 206 | 207 | [2018/3/7 @ 12:13:19] TETS 208 | 209 | [2018/3/7 @ 12:13:21] TESTTEST 210 | 211 | [2018/3/7 @ 12:13:40] LOGIN TEMP 212 | 213 | [2018/3/7 @ 12:13:42] TEST 214 | 215 | [2018/3/7 @ 12:13:44] TESTTEST 216 | 217 | [2018/3/7 @ 12:13:45] TESTTEST 218 | 219 | [2018/3/7 @ 12:16:11] LOGIN TMP 220 | 221 | [2018/3/7 @ 12:16:13] TEST 222 | 223 | [2018/3/7 @ 12:16:14] TESTTEST 224 | 225 | [2018/3/7 @ 12:16:16] TESTTEST 226 | 227 | [2018/3/7 @ 12:18:45] LOGIN TMP 228 | 229 | [2018/3/7 @ 12:18:47] TEST 230 | 231 | [2018/3/7 @ 12:18:49] TESTTEST 232 | 233 | [2018/3/7 @ 12:18:51] TESTTEST 234 | 235 | [2018/3/7 @ 12:20:34] LOGIN TMP 236 | 237 | [2018/3/7 @ 12:20:36] TEST 238 | 239 | [2018/3/7 @ 12:20:37] TESTTEST 240 | 241 | [2018/3/7 @ 12:20:41] TESTTEST 242 | 243 | [2018/3/7 @ 12:21:33] LOGIN TMP 244 | 245 | [2018/3/7 @ 12:21:36] TEST 246 | 247 | [2018/3/7 @ 12:21:38] TESTTEST 248 | 249 | [2018/3/7 @ 12:21:53] TESTTEST 250 | 251 | [2018/3/7 @ 12:24:8] LOGIN TMP 252 | 253 | [2018/3/7 @ 12:24:10] TEST 254 | 255 | [2018/3/7 @ 12:24:12] TESTTEST 256 | 257 | [2018/3/7 @ 12:24:15] TESTTEST 258 | 259 | [2018/3/7 @ 12:26:7] AltAltLOGIN TMP 260 | 261 | [2018/3/7 @ 12:26:12] LOGIN TMP 262 | 263 | [2018/3/7 @ 12:26:14] 264 | 265 | [2018/3/7 @ 12:26:16] 266 | 267 | [2018/3/7 @ 12:34:56] LOGIN TMP 268 | 269 | [2018/3/7 @ 12:34:58] TEST 270 | 271 | [2018/3/7 @ 12:35:0] TESTTEST 272 | 273 | [2018/3/7 @ 12:35:4] TESTTEST 274 | 275 | [2018/3/7 @ 12:35:55] LOGIN TMP 276 | 277 | [2018/3/7 @ 12:35:57] TEST 278 | 279 | [2018/3/7 @ 12:35:59] TESTTEST 280 | 281 | [2018/3/7 @ 12:36:2] TESTTEST 282 | 283 | [2018/3/7 @ 12:40:59] LOGIN TMP 284 | 285 | [2018/3/7 @ 12:41:1] TEST 286 | 287 | [2018/3/7 @ 12:41:3] TESTTEST 288 | 289 | [2018/3/7 @ 12:41:6] TESTTEST 290 | 291 | [2018/3/7 @ 12:46:22] LOGIN TMP 292 | 293 | [2018/3/7 @ 12:46:25] TEST2 294 | 295 | [2018/3/7 @ 12:46:27] TESTTEST 296 | 297 | [2018/3/7 @ 12:46:31] TESTTEST 298 | 299 | -------------------------------------------------------------------------------- /filesystem/test.z: -------------------------------------------------------------------------------- 1 | // each loop 2 | // use for looping over array 3 | 4 | [1, 2, 3, 4, 5] { 5 | x = [1, 2, 3, 4, 5] 6 | 7 | x { 8 | echo i 9 | } 10 | } 11 | 12 | // for loop 13 | // there are no steps, you can use modulo 14 | 15 | i = 1 in 10 { 16 | 17 | // if statement 18 | 19 | i % 3 == 0 { 20 | 21 | echo call(add, i, 2) 22 | 23 | } || i % 3 == 1 { 24 | 25 | // or clause with condition 26 | // works like else if 27 | 28 | echo i 29 | 30 | } || { 31 | 32 | // or clause 33 | // this works like else 34 | 35 | echo i 36 | 37 | } 38 | } 39 | 40 | // subroutine 41 | 42 | add(x, y): 43 | x + y 44 | -------------------------------------------------------------------------------- /grid.gd: -------------------------------------------------------------------------------- 1 | extends ImmediateGeometry 2 | 3 | var size_cell = 1 4 | var size_grid = 20 5 | 6 | func _ready(): 7 | for cell in range(0, size_grid, size_cell): 8 | self.begin(ArrayMesh.PRIMITIVE_LINES, SpatialMaterial) 9 | self.add_vertex(Vector3(cell, 0, 0)) 10 | self.add_vertex(Vector3(cell, 0, size_grid - 1)) 11 | self.end() 12 | self.begin(ArrayMesh.PRIMITIVE_LINES, SpatialMaterial) 13 | self.add_vertex(Vector3(0, 0, cell)) 14 | self.add_vertex(Vector3(size_grid - 1, 0, cell)) 15 | self.end() 16 | -------------------------------------------------------------------------------- /http.gd: -------------------------------------------------------------------------------- 1 | extends HTTPRequest 2 | 3 | var reference = null 4 | 5 | func get(url, ref): 6 | reference = ref 7 | self.request(str("http://zerosploit-api.herokuapp.com/", url)) 8 | 9 | func _on_HTTPRequest_request_completed(result, response_code, headers, body): 10 | var json = JSON.parse(body.get_string_from_utf8()) 11 | var ips = [] 12 | 13 | reference.handle_results(json.result[json.result.keys()[0]]) 14 | -------------------------------------------------------------------------------- /http.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://http.gd" type="Script" id=1] 4 | 5 | [node name="HTTPRequest" type="HTTPRequest" index="0"] 6 | 7 | download_file = "" 8 | use_threads = false 9 | body_size_limit = -1 10 | max_redirects = 8 11 | script = ExtResource( 1 ) 12 | 13 | [connection signal="request_completed" from="." to="." method="_on_HTTPRequest_request_completed"] 14 | 15 | 16 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | 7 | [deps] 8 | 9 | source_file="res://icon.png" 10 | source_md5="ae7e641067601e2184afcade49abd283" 11 | 12 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 13 | dest_md5="84511021bbc8c9d37c7f0f4d181de883" 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/normal_map=0 21 | flags/repeat=0 22 | flags/filter=true 23 | flags/mipmaps=false 24 | flags/anisotropic=false 25 | flags/srgb=2 26 | process/fix_alpha_border=true 27 | process/premult_alpha=false 28 | process/HDR_as_SRGB=false 29 | stream=false 30 | size_limit=0 31 | detect_3d=true 32 | svg/scale=1.0 33 | -------------------------------------------------------------------------------- /installer.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var root = false 4 | var console = false 5 | var step = 0 6 | var itimer = Timer.new() 7 | var steps = [ 8 | 'Downloading...', 9 | 'Configuring...', 10 | 'Compiling...', 11 | 'Installed!' 12 | ] 13 | 14 | func _ready(): 15 | root = get_parent() 16 | console = root.get_node('console') 17 | 18 | func portscan(): 19 | var price = 10 20 | 21 | if root == false: 22 | root = get_parent() 23 | console = root.get_node('console') 24 | 25 | if root.money - price >= 0: 26 | console.echo("Installing portscan...") 27 | itimer.set_wait_time(1) 28 | itimer.connect("timeout", self, "_on_install_timeout") 29 | add_child(itimer) 30 | itimer.start() 31 | else: 32 | console.echo("Insufficient funds...") 33 | 34 | func _on_install_timeout(): 35 | if step < len(steps): 36 | console.echo(steps[step]) 37 | step += 1 38 | else: 39 | itimer.stop() 40 | step = 0 41 | -------------------------------------------------------------------------------- /lobby.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | func _ready(): 4 | var Http = load("http.gd") 5 | 6 | func _on_Button_pressed(): 7 | var lineedit = get_node('PanelContainer/Panel/LineEdit') 8 | var ip = lineedit.text 9 | 10 | var http = HTTPClient.new() 11 | var err = http.connect_to_host("zerosploit-api.herokuapp.com", 80) 12 | assert(err == OK) 13 | 14 | while http.get_status() == HTTPClient.STATUS_CONNECTING or http.get_status() == HTTPClient.STATUS_RESOLVING: 15 | http.poll() 16 | print("Connecting...") 17 | OS.delay_msec(500) 18 | 19 | assert(http.get_status() == HTTPClient.STATUS_CONNECTED) 20 | 21 | var body = str("server[ip]=", ip) 22 | 23 | http.request( 24 | HTTPClient.METHOD_POST, 25 | '/servers.json', 26 | ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(body.length())], 27 | body 28 | ) 29 | -------------------------------------------------------------------------------- /lobby.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://lobby.gd" type="Script" id=1] 4 | [ext_resource path="res://LineEdit.gd" type="Script" id=2] 5 | [ext_resource path="res://ServerListing.gd" type="Script" id=3] 6 | 7 | [node name="lobby" type="Spatial"] 8 | 9 | script = ExtResource( 1 ) 10 | 11 | [node name="PanelContainer" type="PanelContainer" parent="." index="0"] 12 | 13 | anchor_left = 0.0 14 | anchor_top = 0.0 15 | anchor_right = 0.0 16 | anchor_bottom = 0.0 17 | margin_right = 1021.0 18 | margin_bottom = 598.0 19 | rect_pivot_offset = Vector2( 0, 0 ) 20 | mouse_filter = 0 21 | mouse_default_cursor_shape = 0 22 | size_flags_horizontal = 1 23 | size_flags_vertical = 1 24 | 25 | [node name="Panel" type="Panel" parent="PanelContainer" index="0"] 26 | 27 | anchor_left = 0.0 28 | anchor_top = 0.0 29 | anchor_right = 0.0 30 | anchor_bottom = 0.0 31 | margin_left = 7.0 32 | margin_top = 7.0 33 | margin_right = 1014.0 34 | margin_bottom = 591.0 35 | rect_pivot_offset = Vector2( 0, 0 ) 36 | mouse_filter = 0 37 | mouse_default_cursor_shape = 0 38 | size_flags_horizontal = 1 39 | size_flags_vertical = 1 40 | 41 | [node name="LineEdit" type="LineEdit" parent="PanelContainer/Panel" index="0"] 42 | 43 | anchor_left = 0.0 44 | anchor_top = 0.0 45 | anchor_right = 0.0 46 | anchor_bottom = 0.0 47 | margin_right = 635.0 48 | margin_bottom = 24.0 49 | rect_pivot_offset = Vector2( 0, 0 ) 50 | focus_mode = 2 51 | mouse_filter = 0 52 | mouse_default_cursor_shape = 1 53 | size_flags_horizontal = 1 54 | size_flags_vertical = 1 55 | focus_mode = 2 56 | context_menu_enabled = true 57 | placeholder_alpha = 0.6 58 | caret_blink = false 59 | caret_blink_speed = 0.65 60 | caret_position = 0 61 | script = ExtResource( 2 ) 62 | 63 | [node name="Button" type="Button" parent="PanelContainer/Panel" index="1"] 64 | 65 | anchor_left = 0.0 66 | anchor_top = 0.0 67 | anchor_right = 0.0 68 | anchor_bottom = 0.0 69 | margin_left = 646.0 70 | margin_top = 2.0 71 | margin_right = 729.0 72 | margin_bottom = 22.0 73 | rect_pivot_offset = Vector2( 0, 0 ) 74 | focus_mode = 2 75 | mouse_filter = 0 76 | mouse_default_cursor_shape = 0 77 | size_flags_horizontal = 1 78 | size_flags_vertical = 1 79 | toggle_mode = false 80 | enabled_focus_mode = 2 81 | shortcut = null 82 | group = null 83 | text = "Start Game" 84 | flat = false 85 | align = 1 86 | 87 | [node name="ServerListing" type="TextEdit" parent="PanelContainer/Panel" index="2"] 88 | 89 | anchor_left = 0.0 90 | anchor_top = 0.0 91 | anchor_right = 0.0 92 | anchor_bottom = 0.0 93 | margin_left = 8.0 94 | margin_top = 33.0 95 | margin_right = 634.0 96 | margin_bottom = 574.0 97 | rect_pivot_offset = Vector2( 0, 0 ) 98 | focus_mode = 2 99 | mouse_filter = 0 100 | mouse_default_cursor_shape = 0 101 | size_flags_horizontal = 1 102 | size_flags_vertical = 1 103 | text = "" 104 | readonly = false 105 | highlight_current_line = false 106 | syntax_highlighting = false 107 | show_line_numbers = false 108 | highlight_all_occurrences = false 109 | override_selected_font_color = false 110 | context_menu_enabled = true 111 | smooth_scrolling = false 112 | v_scroll_speed = 80.0 113 | hiding_enabled = 0 114 | wrap_lines = false 115 | caret_block_mode = false 116 | caret_blink = false 117 | caret_blink_speed = 0.65 118 | caret_moving_by_right_click = true 119 | script = ExtResource( 3 ) 120 | 121 | [node name="HTTPRequest" type="HTTPRequest" parent="." index="1"] 122 | 123 | download_file = "" 124 | use_threads = false 125 | body_size_limit = -1 126 | max_redirects = 8 127 | 128 | [node name="ServersRequest" type="HTTPRequest" parent="." index="2"] 129 | 130 | download_file = "" 131 | use_threads = false 132 | body_size_limit = -1 133 | max_redirects = 8 134 | 135 | [connection signal="pressed" from="PanelContainer/Panel/Button" to="." method="_on_Button_pressed"] 136 | 137 | [connection signal="request_completed" from="HTTPRequest" to="PanelContainer/Panel/LineEdit" method="_on_HTTPRequest_request_completed"] 138 | 139 | [connection signal="request_completed" from="ServersRequest" to="PanelContainer/Panel/ServerListing" method="_on_ServersRequest_request_completed"] 140 | 141 | 142 | -------------------------------------------------------------------------------- /main.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | var players = [] 4 | var console_show = false 5 | var money = 1000 6 | var bandwidth = 14.4 7 | var timecop = Timer.new() 8 | 9 | func _ready(): 10 | $console.hide() 11 | timecop.set_wait_time(60) 12 | timecop.connect("timeout", self, "_on_timecop_timeout") 13 | add_child(timecop) 14 | timecop.start() 15 | $network.start_server() 16 | 17 | func _input(event): 18 | if event.is_pressed() && !Input.is_key_pressed(16777232) && !Input.is_key_pressed(16777234) && !Input.is_key_pressed(16777231) && !Input.is_key_pressed(16777233): 19 | if console_show == false: 20 | $console.show() 21 | $console.grab_focus() 22 | $console.shown = true 23 | 24 | func _on_timecop_timeout(): 25 | for player in players: 26 | if len(player.connections) == 0: 27 | if player.delete_tag == false: 28 | player.delete_tag = true 29 | 30 | $console.echo("Zombie (unconnected) instance(s) in your network!") 31 | $console.echo("Tagged for deletion at next timecop run...") 32 | else: 33 | players.erase(player) 34 | player.queue_free() 35 | 36 | $console.echo("Zombie instance(s) deleted!") 37 | -------------------------------------------------------------------------------- /main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=11 format=2] 2 | 3 | [ext_resource path="res://main.gd" type="Script" id=1] 4 | [ext_resource path="res://grid.gd" type="Script" id=2] 5 | [ext_resource path="res://F25_Bank_Printer.ttf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://console.gd" type="Script" id=4] 7 | [ext_resource path="res://network.gd" type="Script" id=5] 8 | [ext_resource path="res://installer.gd" type="Script" id=6] 9 | [ext_resource path="res://editor.gd" type="Script" id=7] 10 | [ext_resource path="res://account.gd" type="Script" id=8] 11 | 12 | [sub_resource type="CanvasItemMaterial" id=1] 13 | 14 | render_priority = 0 15 | blend_mode = 0 16 | light_mode = 0 17 | 18 | [sub_resource type="DynamicFont" id=2] 19 | 20 | size = 12 21 | use_mipmaps = false 22 | use_filter = false 23 | font_data = ExtResource( 3 ) 24 | _sections_unfolded = [ "Font", "Resource", "Settings" ] 25 | 26 | [node name="root" type="Spatial"] 27 | 28 | script = ExtResource( 1 ) 29 | 30 | [node name="grid" type="ImmediateGeometry" parent="." index="0"] 31 | 32 | layers = 1 33 | material_override = null 34 | cast_shadow = 1 35 | extra_cull_margin = 0.0 36 | use_in_baked_light = false 37 | lod_min_distance = 0.0 38 | lod_min_hysteresis = 0.0 39 | lod_max_distance = 0.0 40 | lod_max_hysteresis = 0.0 41 | script = ExtResource( 2 ) 42 | 43 | [node name="console" type="TextEdit" parent="." index="1"] 44 | 45 | modulate = Color( 1, 1, 1, 0.501961 ) 46 | material = SubResource( 1 ) 47 | anchor_left = 0.0 48 | anchor_top = 0.0 49 | anchor_right = 0.0 50 | anchor_bottom = 0.0 51 | margin_right = 1024.0 52 | margin_bottom = 600.0 53 | rect_pivot_offset = Vector2( 0, 0 ) 54 | focus_mode = 2 55 | mouse_filter = 0 56 | mouse_default_cursor_shape = 0 57 | size_flags_horizontal = 1 58 | size_flags_vertical = 1 59 | custom_fonts/font = SubResource( 2 ) 60 | custom_colors/background_color = Color( 0, 0, 0, 0.602196 ) 61 | text = "" 62 | readonly = false 63 | highlight_current_line = false 64 | syntax_highlighting = false 65 | show_line_numbers = false 66 | highlight_all_occurrences = false 67 | override_selected_font_color = false 68 | context_menu_enabled = true 69 | smooth_scrolling = false 70 | v_scroll_speed = 80.0 71 | hiding_enabled = 0 72 | wrap_lines = false 73 | caret_block_mode = true 74 | caret_blink = true 75 | caret_blink_speed = 0.65 76 | caret_moving_by_right_click = true 77 | script = ExtResource( 4 ) 78 | _sections_unfolded = [ "Rect" ] 79 | 80 | [node name="network" type="Node" parent="." index="2"] 81 | 82 | script = ExtResource( 5 ) 83 | 84 | [node name="installer" type="Node" parent="." index="3"] 85 | 86 | script = ExtResource( 6 ) 87 | 88 | [node name="editor" type="Node" parent="." index="4"] 89 | 90 | script = ExtResource( 7 ) 91 | 92 | [node name="HTTPRequest" type="HTTPRequest" parent="." index="5"] 93 | 94 | download_file = "" 95 | use_threads = false 96 | body_size_limit = -1 97 | max_redirects = 8 98 | 99 | [node name="account" type="Node" parent="." index="6"] 100 | 101 | script = ExtResource( 8 ) 102 | 103 | 104 | -------------------------------------------------------------------------------- /network.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | const DEFAULT_PORT = 31416 4 | const MAX_PEERS = 10 5 | var players = {} 6 | var player_name 7 | 8 | func _ready(): 9 | get_tree().connect("network_peer_connected", self, "_player_connected") 10 | get_tree().connect("network_peer_disconnected", self, "_player_disconnected") 11 | get_tree().connect("connected_to_server", self, "_connected_ok") 12 | get_tree().connect("connection_failed", self, "_connected_fail") 13 | get_tree().connect("server_disconnected", self, "_server_disconnect") 14 | 15 | func start_server(): 16 | player_name = 'Server' 17 | var host = NetworkedMultiplayerENet.new() 18 | 19 | var err = host.create_server(DEFAULT_PORT, MAX_PEERS) 20 | 21 | if (err!=OK): 22 | join_server() 23 | return 24 | 25 | get_tree().set_network_peer(host) 26 | 27 | spawn_player(1) 28 | 29 | func join_server(): 30 | player_name = 'Client' 31 | var host = NetworkedMultiplayerENet.new() 32 | 33 | host.create_client('127.0.0.1', DEFAULT_PORT) 34 | get_tree().set_network_peer(host) 35 | 36 | func _player_connected(id): 37 | pass 38 | 39 | func _player_disconnected(id): 40 | unregister_player(id) 41 | rpc("unregister_player", id) 42 | 43 | func _connected_ok(): 44 | rpc_id(1, "user_ready", get_tree().get_network_unique_id(), player_name) 45 | 46 | remote func user_ready(id, player_name): 47 | if get_tree().is_network_server(): 48 | rpc_id(id, "register_in_game") 49 | 50 | remote func register_in_game(): 51 | rpc("register_new_player", get_tree().get_network_unique_id(), player_name) 52 | register_new_player(get_tree().get_network_unique_id(), player_name) 53 | 54 | func _server_disconnected(): 55 | quit_game() 56 | 57 | remote func register_new_player(id, name): 58 | if get_tree().is_network_server(): 59 | rpc_id(id, "register_new_player", 1, player_name) 60 | 61 | for peer_id in players: 62 | rpc_id(id, "register_new_player", peer_id, players[peer_id]) 63 | 64 | players[id] = name 65 | spawn_player(id) 66 | 67 | remote func register_player(id, name): 68 | if get_tree().is_network_server(): 69 | rpc_id(id, "register_player", 1, player_name) 70 | 71 | for peer_id in players: 72 | rpc_id(id, "register_player", peer_id, players[peer_id]) 73 | rpc_id(peer_id, "register_player", id, name) 74 | 75 | players[id] = name 76 | 77 | remote func unregister_player(id): 78 | get_node("/root/" + str(id)).queue_free() 79 | players.erase(id) 80 | 81 | func quit_game(): 82 | get_tree().set_network_peer(null) 83 | players.clear() 84 | 85 | func spawn_player(id): 86 | var player_scene = load("res://player.tscn") 87 | var player = player_scene.instance() 88 | 89 | player.set_name(str(id)) 90 | 91 | if id == get_tree().get_network_unique_id(): 92 | player.set_network_master(id) 93 | 94 | player.player_id = id 95 | player.control = true 96 | 97 | get_parent().add_child(player) 98 | -------------------------------------------------------------------------------- /player.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | var dir = { 4 | "N":[ 5 | Vector3(0, 0, -1), 6 | Vector3(0, 0, 1), 7 | Vector3(-1, 0, 0), 8 | Vector3(1, 0, 0) 9 | ], 10 | "S":[ 11 | Vector3(0, 0, 1), 12 | Vector3(0, 0, -1), 13 | Vector3(1, 0, 0), 14 | Vector3(-1, 0, 0) 15 | ], 16 | "W":[ 17 | Vector3(-1, 0, 0), 18 | Vector3(1, 0, 0), 19 | Vector3(0, 0, 1), 20 | Vector3(0, 0, -1) 21 | ], 22 | "O":[ 23 | Vector3(1, 0, 0), 24 | Vector3(-1, 0, 0), 25 | Vector3(0, 0, -1), 26 | Vector3(0, 0, 1) 27 | ] 28 | } 29 | 30 | var control = false 31 | var player_id = 0 32 | var direct = ["N", "W", "S", "O"] 33 | var move = "stop" 34 | var step = 0 35 | var pos = Vector3(10, 1, 10) 36 | var rotL = 0; 37 | var rotR = 0; 38 | var id = {16777232:0, 16777234:1, 16777231:2, 16777233:3} 39 | var root = false 40 | var console = false 41 | var tree = {} 42 | 43 | func _ready(): 44 | self.set_translation(Vector3(pos.x, 1, pos.x)) 45 | 46 | root = get_parent() 47 | console = root.get_node('console') 48 | 49 | set_process(true) 50 | 51 | func step_mov(key): 52 | if (Input.is_key_pressed(key) and move == "stop") or move == direct[id[key]]: 53 | move = direct[id[key]] 54 | step += 1 55 | pos += 0.02 * dir[direct[0]][id[key]] 56 | 57 | if step == 50: 58 | move = "stop" 59 | step = 0 60 | pos = Vector3(round(pos.x), 1, round(pos.z)) 61 | 62 | var movement = Vector3(pos.x, 1, pos.z) 63 | 64 | set_translation(movement) 65 | rpc_unreliable("do_move", movement, player_id) 66 | 67 | remote func do_move(position, pid): 68 | var root = get_parent() 69 | var pnode = root.get_node(str(pid)) 70 | 71 | pnode.set_translation(position) 72 | 73 | func rot(): 74 | if (Input.is_key_pressed(16777235)) and step == 0 and rotR == 0 or rotL != 0: 75 | if rotL == 0: 76 | direct.push_back(direct[0]) 77 | direct.pop_front() 78 | 79 | rotL += 1 80 | 81 | if rotL == 100: 82 | rotL = 0 83 | 84 | self.rotate(Vector3(0, 1, 0), -0.0157) 85 | 86 | if (Input.is_key_pressed(16777236)) and step == 0 and rotL == 0 or rotR != 0: 87 | if rotR == 0: 88 | direct.push_front(direct[3]) 89 | direct.pop_back() 90 | 91 | rotR += 1 92 | 93 | if rotR == 100: 94 | rotR = 0 95 | 96 | self.rotate(Vector3(0, 1, 0), 0.0157) 97 | 98 | func _process(delta): 99 | if control == true: 100 | if console && console.shown: 101 | pass 102 | else: 103 | step_mov(KEY_UP) 104 | step_mov(KEY_DOWN) 105 | step_mov(KEY_LEFT) 106 | step_mov(KEY_RIGHT) 107 | rot() 108 | -------------------------------------------------------------------------------- /player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://player.gd" type="Script" id=1] 4 | 5 | [sub_resource type="CubeMesh" id=1] 6 | 7 | size = Vector3( 2, 2, 2 ) 8 | subdivide_width = 0 9 | subdivide_height = 0 10 | subdivide_depth = 0 11 | 12 | [node name="player" type="Spatial" index="0"] 13 | 14 | script = ExtResource( 1 ) 15 | 16 | [node name="Camera" type="Camera" parent="." index="0"] 17 | 18 | keep_aspect = 1 19 | cull_mask = 1048575 20 | environment = null 21 | h_offset = 0.0 22 | v_offset = 0.0 23 | doppler_tracking = 0 24 | projection = 0 25 | current = false 26 | fov = 70.0 27 | size = 1.0 28 | near = 0.05 29 | far = 100.0 30 | 31 | [node name="MeshInstance" type="MeshInstance" parent="." index="1"] 32 | 33 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5.57576 ) 34 | layers = 1 35 | material_override = null 36 | cast_shadow = 1 37 | extra_cull_margin = 0.0 38 | use_in_baked_light = false 39 | lod_min_distance = 0.0 40 | lod_min_hysteresis = 0.0 41 | lod_max_distance = 0.0 42 | lod_max_hysteresis = 0.0 43 | mesh = SubResource( 1 ) 44 | skeleton = NodePath("..") 45 | material/0 = null 46 | _sections_unfolded = [ "Transform" ] 47 | 48 | 49 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=3 10 | 11 | [application] 12 | 13 | config/name="zerosploit" 14 | run/main_scene="res://lobby.tscn" 15 | config/icon="res://icon.png" 16 | 17 | [rendering] 18 | 19 | environment/default_environment="res://default_env.tres" 20 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # zerosploit 2 | 3 | A multi-player real-time strategy game where you have to hack your opponent, while protecting yourself by building the most secure network possible. 4 | 5 | The game features its own built-in scripting language, so you can automate any task you want, and give you very fine-grained control. 6 | 7 | More info on [YouTube](https://www.youtube.com/channel/UCqLl5Limi4AZZpMXqF1LHtA) 8 | -------------------------------------------------------------------------------- /server.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | var price = 100 4 | var ip = [1, 0, 0, 0] 5 | var connections = [] 6 | var delete_tag = false 7 | var console = false 8 | 9 | func _ready(): 10 | randomize() 11 | 12 | ip = [ 13 | randi() % 255 + 1, 14 | randi() % 255 + 1, 15 | randi() % 255 + 1, 16 | randi() % 255 + 1 17 | ] 18 | 19 | var root = get_parent() 20 | console = root.get_node('console') 21 | 22 | console.echo(str("server instantiated: ", ip)) 23 | 24 | func ping(): 25 | return "pong" 26 | 27 | func config(): 28 | console.echo("Configuring server...") -------------------------------------------------------------------------------- /server.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://server.gd" type="Script" id=1] 4 | 5 | [sub_resource type="CubeMesh" id=1] 6 | 7 | size = Vector3( 2, 2, 2 ) 8 | subdivide_width = 0 9 | subdivide_height = 0 10 | subdivide_depth = 0 11 | 12 | [node name="Spatial" type="Spatial" index="0"] 13 | 14 | script = ExtResource( 1 ) 15 | 16 | [node name="MeshInstance" type="MeshInstance" parent="." index="0"] 17 | 18 | layers = 1 19 | material_override = null 20 | cast_shadow = 1 21 | extra_cull_margin = 0.0 22 | use_in_baked_light = false 23 | lod_min_distance = 0.0 24 | lod_min_hysteresis = 0.0 25 | lod_max_distance = 0.0 26 | lod_max_hysteresis = 0.0 27 | mesh = SubResource( 1 ) 28 | skeleton = NodePath("..") 29 | material/0 = null 30 | 31 | 32 | -------------------------------------------------------------------------------- /test.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/test.exe -------------------------------------------------------------------------------- /test.pck: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheApeMachine/zerosploit/a6081f4c31f001725f4324246fe4be05a78ac0cc/test.pck --------------------------------------------------------------------------------