sc2ai 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/sc2ai/protocol/common.proto +6 -6
- data/data/sc2ai/protocol/data.proto +23 -20
- data/data/sc2ai/protocol/debug.proto +25 -21
- data/data/sc2ai/protocol/error.proto +217 -215
- data/data/sc2ai/protocol/query.proto +1 -1
- data/data/sc2ai/protocol/raw.proto +16 -14
- data/data/sc2ai/protocol/sc2api.proto +108 -94
- data/data/sc2ai/protocol/score.proto +4 -3
- data/data/sc2ai/protocol/spatial.proto +6 -5
- data/data/sc2ai/protocol/ui.proto +17 -14
- data/exe/sc2ai +0 -3
- data/lib/docker_build/Dockerfile.ruby +4 -2
- data/lib/sc2ai/api/ability_id.rb +6 -1
- data/lib/sc2ai/api/data.rb +18 -3
- data/lib/sc2ai/api/tech_tree.rb +1 -1
- data/lib/sc2ai/api/tech_tree_data.rb +54 -3
- data/lib/sc2ai/connection/connection_listener.rb +3 -3
- data/lib/sc2ai/connection/requests.rb +31 -35
- data/lib/sc2ai/connection/status_listener.rb +1 -1
- data/lib/sc2ai/connection.rb +1 -2
- data/lib/sc2ai/local_play/client.rb +2 -2
- data/lib/sc2ai/local_play/match.rb +7 -2
- data/lib/sc2ai/overrides/async/process/child.rb +1 -1
- data/lib/sc2ai/paths.rb +12 -2
- data/lib/sc2ai/player/actions.rb +54 -35
- data/lib/sc2ai/player/debug.rb +54 -20
- data/lib/sc2ai/player/game_state.rb +11 -18
- data/lib/sc2ai/player/geo.rb +56 -66
- data/lib/sc2ai/player/units.rb +41 -17
- data/lib/sc2ai/player.rb +104 -47
- data/lib/sc2ai/ports.rb +1 -2
- data/lib/sc2ai/protocol/_meta_documentation.rb +270 -25
- data/lib/sc2ai/protocol/common_pb.rb +3862 -33
- data/lib/sc2ai/protocol/data_pb.rb +9106 -36
- data/lib/sc2ai/protocol/debug_pb.rb +10434 -45
- data/lib/sc2ai/protocol/error_pb.rb +1084 -29
- data/lib/sc2ai/protocol/extensions/ability_remapable.rb +9 -9
- data/lib/sc2ai/protocol/extensions/action.rb +60 -0
- data/lib/sc2ai/protocol/extensions/point_2_d.rb +9 -0
- data/lib/sc2ai/protocol/extensions/position.rb +11 -36
- data/lib/sc2ai/protocol/extensions/power_source.rb +3 -0
- data/lib/sc2ai/protocol/extensions/unit.rb +61 -36
- data/lib/sc2ai/protocol/extensions/unit_type_data.rb +8 -0
- data/lib/sc2ai/protocol/query_pb.rb +5022 -36
- data/lib/sc2ai/protocol/raw_pb.rb +18347 -46
- data/lib/sc2ai/protocol/sc2api_pb.rb +48424 -126
- data/lib/sc2ai/protocol/score_pb.rb +5965 -30
- data/lib/sc2ai/protocol/spatial_pb.rb +11941 -37
- data/lib/sc2ai/protocol/ui_pb.rb +12924 -46
- data/lib/sc2ai/unit_group/action_ext.rb +0 -2
- data/lib/sc2ai/unit_group/filter_ext.rb +24 -8
- data/lib/sc2ai/unit_group/geo_ext.rb +0 -2
- data/lib/sc2ai/unit_group.rb +1 -1
- data/lib/sc2ai/version.rb +2 -3
- data/lib/sc2ai.rb +10 -11
- data/lib/templates/ladderzip/bin/ladder.tt +0 -3
- data/lib/templates/new/.ladderignore +15 -5
- data/lib/templates/new/api/common.proto +6 -6
- data/lib/templates/new/api/data.proto +23 -20
- data/lib/templates/new/api/debug.proto +25 -21
- data/lib/templates/new/api/error.proto +217 -215
- data/lib/templates/new/api/query.proto +1 -1
- data/lib/templates/new/api/raw.proto +16 -14
- data/lib/templates/new/api/sc2api.proto +108 -94
- data/lib/templates/new/api/score.proto +4 -3
- data/lib/templates/new/api/spatial.proto +6 -5
- data/lib/templates/new/api/ui.proto +17 -14
- data/lib/templates/new/boot.rb.tt +1 -1
- data/lib/templates/new/my_bot.rb.tt +2 -2
- data/lib/templates/new/run_example_match.rb.tt +2 -2
- data/sig/sc2ai.rbs +11072 -1651
- metadata +31 -26
- data/lib/sc2ai/overrides/kernel.rb +0 -33
- data/lib/sc2ai/protocol/extensions/unit_type.rb +0 -9
data/lib/sc2ai/player.rb
CHANGED
@@ -21,10 +21,10 @@ module Sc2
|
|
21
21
|
extend Forwardable
|
22
22
|
def_delegators :@api, :add_listener
|
23
23
|
|
24
|
-
# Known races for detecting race on Api::Race::
|
24
|
+
# Known races for detecting race on Api::Race::RANDOM or nil
|
25
25
|
# @!attribute IDENTIFIED_RACES
|
26
|
-
#
|
27
|
-
IDENTIFIED_RACES = [Api::Race::
|
26
|
+
# @return [Array<Integer>]
|
27
|
+
IDENTIFIED_RACES = [Api::Race::PROTOSS, Api::Race::TERRAN, Api::Race::ZERG].freeze
|
28
28
|
|
29
29
|
# @!attribute api
|
30
30
|
# Manages connection to client and performs Requests
|
@@ -51,27 +51,22 @@ module Sc2
|
|
51
51
|
# @return [Hash]
|
52
52
|
attr_accessor :interface_options
|
53
53
|
|
54
|
-
# @return [Api::Race
|
55
|
-
# @return [Api::Race::Terran] if is_a? Bot, Human, BotProcess
|
56
|
-
# @return [Api::Race::Zerg] if is_a? Bot, Human, BotProcess
|
57
|
-
# @return [Api::Race::Protoss] if is_a? Bot, Human, BotProcess
|
58
|
-
# @return [Api::Race::Random] if specified random and in-game race hasn't been scouted yet
|
59
|
-
# @return [nil] if is_a? forgetful person
|
54
|
+
# @return [Integer] Api::Race enum
|
60
55
|
attr_accessor :race
|
61
56
|
|
62
57
|
# @return [String] in-game name
|
63
58
|
attr_accessor :name
|
64
59
|
|
65
|
-
# @return [Api::PlayerType::
|
60
|
+
# @return [Integer] Api::PlayerType::PARTICIPANT, Api::PlayerType::COMPUTER, Api::PlayerType::OBSERVER
|
66
61
|
attr_accessor :type
|
67
62
|
|
68
|
-
# if @type is Api::PlayerType::
|
63
|
+
# if @type is Api::PlayerType::COMPUTER, set one of Api::Difficulty scale 1 to 10
|
69
64
|
# @see Api::Difficulty for options
|
70
|
-
# @return [
|
71
|
-
# @return [Api::Difficulty::CheatInsane] if toughest, int 10
|
65
|
+
# @return [Integer]
|
72
66
|
attr_accessor :difficulty
|
73
67
|
|
74
68
|
# @see Api::AIBuild proto for options
|
69
|
+
# @return [Integer]
|
75
70
|
attr_accessor :ai_build
|
76
71
|
|
77
72
|
# @return [String] ladder matches will set an opponent id
|
@@ -153,7 +148,7 @@ module Sc2
|
|
153
148
|
def join_game(server_host:, port_config:)
|
154
149
|
Sc2.logger.debug { "Player \"#{@name}\" joining game..." }
|
155
150
|
response = @api.join_game(name: @name, race: @race, server_host:, port_config:, enable_feature_layer: @enable_feature_layer, interface_options: @interface_options)
|
156
|
-
if
|
151
|
+
if response.error != :ENUM_RESPONSE_JOIN_GAME_ERROR_UNSET && response.error != :MISSING_PARTICIPATION
|
157
152
|
raise Sc2::Error, "Player \"#{@name}\" join_game failed: #{response.error}"
|
158
153
|
end
|
159
154
|
add_listener(self, klass: Connection::StatusListener)
|
@@ -172,7 +167,7 @@ module Sc2
|
|
172
167
|
# Bot
|
173
168
|
# race != None
|
174
169
|
# name=''
|
175
|
-
# type: Api::PlayerType::
|
170
|
+
# type: Api::PlayerType::PARTICIPANT
|
176
171
|
|
177
172
|
# An object which interacts with an SC2 client and is game-aware.
|
178
173
|
class Bot < Player
|
@@ -193,7 +188,7 @@ module Sc2
|
|
193
188
|
attr_accessor :geo
|
194
189
|
|
195
190
|
def initialize(race:, name:)
|
196
|
-
super(race:, name:, type: Api::PlayerType::
|
191
|
+
super(race:, name:, type: Api::PlayerType::PARTICIPANT, difficulty: nil, ai_build: nil)
|
197
192
|
@previous = Sc2::Player::PreviousState.new
|
198
193
|
@geo = Sc2::Player::Geo.new(self)
|
199
194
|
|
@@ -211,11 +206,12 @@ module Sc2
|
|
211
206
|
# end
|
212
207
|
def configure
|
213
208
|
end
|
209
|
+
|
214
210
|
alias_method :before_join, :configure
|
215
211
|
|
216
212
|
# TODO: If this suffices for Bot and Observer, they should share this code.
|
217
213
|
# Initializes and refreshes game data and runs the game loop
|
218
|
-
# @return [Api::Result::
|
214
|
+
# @return [Integer] One of Api::Result::VICTORY, Api::Result::DEFEAT, Api::Result::TIE, Api::Result::UNDECIDED
|
219
215
|
def play
|
220
216
|
# Step 0
|
221
217
|
prepare_start
|
@@ -227,16 +223,45 @@ module Sc2
|
|
227
223
|
# Callback for step 0
|
228
224
|
on_step
|
229
225
|
|
226
|
+
# Local play prints out avg times
|
227
|
+
unless Sc2.ladder?
|
228
|
+
running_avg_step_times = []
|
229
|
+
average_runtime = 0.0
|
230
|
+
end
|
231
|
+
|
230
232
|
puts ""
|
233
|
+
|
231
234
|
# Step 1 to n
|
235
|
+
i = 0
|
232
236
|
loop do
|
237
|
+
if i >= 5
|
238
|
+
i = 0
|
239
|
+
end
|
233
240
|
r = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
|
234
241
|
perform_actions
|
235
242
|
perform_debug_commands unless Sc2.ladder?
|
236
243
|
step_forward
|
237
|
-
|
244
|
+
|
245
|
+
unless Sc2.ladder?
|
246
|
+
time_delta = (::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - r) * 1000
|
247
|
+
step_delta = game_loop - @previous.game_loop
|
248
|
+
# running_avg_step_times.shift if running_avg_step_times.size == 5
|
249
|
+
running_avg_step_times << [time_delta, step_delta]
|
250
|
+
|
251
|
+
if i == 0
|
252
|
+
sum_t, sum_s = running_avg_step_times.each_with_object([0, 0]) do |n, total|
|
253
|
+
total[0] += n[0]
|
254
|
+
total[1] += n[1]
|
255
|
+
end
|
256
|
+
average_runtime = sum_t / sum_s
|
257
|
+
running_avg_step_times.clear
|
258
|
+
end
|
259
|
+
print "\e[2K#{step_delta} Step(s) Took (ms): #{"%.2f" % time_delta} | Avg (ms/frame): #{"%.2f" % average_runtime}\n\e[1A\r"
|
260
|
+
end
|
261
|
+
|
262
|
+
i += 1
|
238
263
|
return @result unless @result.nil?
|
239
|
-
break if @status != :
|
264
|
+
break if @status != :IN_GAME
|
240
265
|
end
|
241
266
|
end
|
242
267
|
|
@@ -261,11 +286,11 @@ module Sc2
|
|
261
286
|
# Callbacks ---
|
262
287
|
|
263
288
|
# Override to handle game result (:Victory/:Loss/:Tie)
|
264
|
-
# Called when game has ended with a result, i.e. result =
|
265
|
-
# @param result [Symbol] Api::Result::
|
289
|
+
# Called when game has ended with a result, i.e. result = :Victory
|
290
|
+
# @param result [Symbol] Api::Result::VICTORY or Api::Result::DEFEAT or Api::Result::UNDECIDED
|
266
291
|
# @example
|
267
292
|
# def on_finish(result)
|
268
|
-
# if result == :
|
293
|
+
# if result == :VICTORY
|
269
294
|
# puts "Yay!"
|
270
295
|
# else
|
271
296
|
# puts "Lets try again!"
|
@@ -277,7 +302,7 @@ module Sc2
|
|
277
302
|
|
278
303
|
# Called when Random race is first detected.
|
279
304
|
# Override to handle race identification of random enemy.
|
280
|
-
# @param race [Integer] Api::Race
|
305
|
+
# @param race [Integer] see {Api::Race}
|
281
306
|
def on_random_race_detected(race)
|
282
307
|
end
|
283
308
|
|
@@ -301,9 +326,9 @@ module Sc2
|
|
301
326
|
# @example
|
302
327
|
# alerts.each do |alert|
|
303
328
|
# case alert
|
304
|
-
# when :
|
329
|
+
# when :NUCLEAR_LAUNCH_DETECTED
|
305
330
|
# pp "TAKE COVER!"
|
306
|
-
# when :
|
331
|
+
# when :NYDUS_WORM_DETECTED
|
307
332
|
# pp "FIND THE WORM!"
|
308
333
|
# end
|
309
334
|
# end
|
@@ -423,26 +448,26 @@ module Sc2
|
|
423
448
|
# Allows using CLI launch options hash or "laddorconfig.json"-complient launcher.
|
424
449
|
class BotProcess < Player
|
425
450
|
def initialize(race:, name:)
|
426
|
-
super(race:, name:, type: Api::PlayerType::
|
451
|
+
super(race:, name:, type: Api::PlayerType::PARTICIPANT)
|
427
452
|
raise "not implemented"
|
428
453
|
end
|
429
454
|
end
|
430
455
|
|
431
456
|
# A Computer opponent using the game's built-in AI for a Match
|
432
457
|
class Computer < Player
|
433
|
-
# @param race [Integer]
|
434
|
-
# @param difficulty [Integer]
|
435
|
-
# @param ai_build [
|
458
|
+
# @param race [Integer] see {Api::Race}
|
459
|
+
# @param difficulty [Integer] Api::Difficulty::VERY_EASY, Api::Difficulty::VERY_HARD,etc.
|
460
|
+
# @param ai_build [Integer] default: Api::AIBuild::RANDOM_BUILD
|
436
461
|
# @param name [String]
|
437
462
|
# @return [Sc2::Computer]
|
438
|
-
def initialize(race:, difficulty: Api::Difficulty::
|
463
|
+
def initialize(race:, difficulty: Api::Difficulty::VERY_EASY, ai_build: Api::AIBuild::RANDOM_BUILD,
|
439
464
|
name: "Computer")
|
440
|
-
difficulty = Api::Difficulty::
|
441
|
-
ai_build = Api::AIBuild::
|
465
|
+
difficulty = Api::Difficulty::VERY_EASY if difficulty.nil?
|
466
|
+
ai_build = Api::AIBuild::RANDOM_BUILD if ai_build.nil?
|
442
467
|
raise Error, "unknown difficulty: '#{difficulty}'" if Api::Difficulty.lookup(difficulty).nil?
|
443
468
|
raise Error, "unknown difficulty: '#{ai_build}'" if Api::AIBuild.lookup(ai_build).nil?
|
444
469
|
|
445
|
-
super(race:, name:, type: Api::PlayerType::
|
470
|
+
super(race:, name:, type: Api::PlayerType::COMPUTER, difficulty:, ai_build:)
|
446
471
|
end
|
447
472
|
|
448
473
|
# Returns whether or not the player requires a sc2 instance
|
@@ -460,14 +485,14 @@ module Sc2
|
|
460
485
|
# A human player for a Match
|
461
486
|
class Human < Player
|
462
487
|
def initialize(race:, name:)
|
463
|
-
super(race:, name:, type: Api::PlayerType::
|
488
|
+
super(race:, name:, type: Api::PlayerType::PARTICIPANT)
|
464
489
|
end
|
465
490
|
end
|
466
491
|
|
467
492
|
# A spectator for a Match
|
468
493
|
class Observer < Player
|
469
494
|
def initialize(name: nil)
|
470
|
-
super(race: Api::Race::
|
495
|
+
super(race: Api::Race::NO_RACE, name:, type: Api::PlayerType::OBSERVER)
|
471
496
|
end
|
472
497
|
end
|
473
498
|
|
@@ -481,6 +506,29 @@ module Sc2
|
|
481
506
|
|
482
507
|
private
|
483
508
|
|
509
|
+
# @private
|
510
|
+
CALLBACK_METHODS = %i[on_finish
|
511
|
+
on_random_race_detected
|
512
|
+
on_action_errors
|
513
|
+
on_actions_performed
|
514
|
+
on_alerts
|
515
|
+
on_upgrades_completed
|
516
|
+
on_parse_observation_unit
|
517
|
+
on_unit_destroyed
|
518
|
+
on_unit_created
|
519
|
+
on_unit_type_changed
|
520
|
+
on_structure_started
|
521
|
+
on_structure_completed
|
522
|
+
on_unit_damaged]
|
523
|
+
|
524
|
+
# @private
|
525
|
+
# Checks if callback method is defined on our bot
|
526
|
+
# Used to skip processing on unused callbacks
|
527
|
+
# @param callback [Symbol]
|
528
|
+
def callback_defined?(callback)
|
529
|
+
CALLBACK_METHODS.include?(callback)
|
530
|
+
end
|
531
|
+
|
484
532
|
# Initialize data on step 0 before stepping and before on_start is called
|
485
533
|
def prepare_start
|
486
534
|
@data = Sc2::Data.new(@api.data)
|
@@ -525,6 +573,10 @@ module Sc2
|
|
525
573
|
|
526
574
|
# Save previous frame before continuing
|
527
575
|
@previous.reset(self)
|
576
|
+
|
577
|
+
# We can request game info async, while we process observation
|
578
|
+
refresh_game_info
|
579
|
+
|
528
580
|
# Reset
|
529
581
|
self.observation = response_observation.observation
|
530
582
|
self.game_loop = observation.game_loop
|
@@ -532,17 +584,14 @@ module Sc2
|
|
532
584
|
self.spent_minerals = 0
|
533
585
|
self.spent_vespene = 0
|
534
586
|
self.spent_supply = 0
|
535
|
-
|
536
|
-
if observation.raw_data.map_state.visibility != previous.observation&.raw_data&.map_state&.visibility
|
537
|
-
@parsed_visibility_grid = nil
|
538
|
-
end
|
587
|
+
geo.reset
|
539
588
|
|
540
|
-
#
|
541
|
-
|
542
|
-
|
543
|
-
|
589
|
+
# First game-loop: set enemy and our race if random
|
590
|
+
if enemy.nil?
|
591
|
+
# Finish game_info load immediately, because we need it's info
|
592
|
+
game_info
|
544
593
|
set_enemy
|
545
|
-
set_race_for_random if race == Api::Race::
|
594
|
+
set_race_for_random if race == Api::Race::RANDOM
|
546
595
|
end
|
547
596
|
|
548
597
|
parse_observation_units(response_observation.observation)
|
@@ -554,7 +603,12 @@ module Sc2
|
|
554
603
|
|
555
604
|
# Actions performed and errors (only if implemented)
|
556
605
|
on_actions_performed(response_observation.actions) unless response_observation.actions.empty?
|
557
|
-
on_action_errors
|
606
|
+
if callback_defined?(:on_action_errors)
|
607
|
+
unless response_observation.action_errors.empty?
|
608
|
+
@action_errors.concat(response_observation.action_errors.to_a)
|
609
|
+
end
|
610
|
+
on_action_errors(@action_errors) unless @action_errors&.empty?
|
611
|
+
end
|
558
612
|
on_alerts(observation.alerts) unless observation.alerts.empty?
|
559
613
|
|
560
614
|
# Diff previous observation upgrades to see if anything new completed
|
@@ -583,7 +637,10 @@ module Sc2
|
|
583
637
|
# Refreshes bot#game_info ignoring all caches
|
584
638
|
# @return [void]
|
585
639
|
public def refresh_game_info
|
586
|
-
|
640
|
+
@game_info_task = Async do
|
641
|
+
self.game_info = @api.game_info
|
642
|
+
@game_info_task = nil
|
643
|
+
end
|
587
644
|
end
|
588
645
|
|
589
646
|
# Enemy -----------------------
|
@@ -600,7 +657,7 @@ module Sc2
|
|
600
657
|
self.enemy = Sc2::Player::Enemy.from_proto(player_info: enemy_player_info)
|
601
658
|
|
602
659
|
if enemy.nil?
|
603
|
-
self.enemy = Sc2::Player::Enemy.new(name: "Unknown", race: Api::Race::
|
660
|
+
self.enemy = Sc2::Player::Enemy.new(name: "Unknown", race: Api::Race::RANDOM)
|
604
661
|
end
|
605
662
|
if enemy.race_unknown?
|
606
663
|
detected_race = enemy.detect_race_from_units
|
data/lib/sc2ai/ports.rb
CHANGED
@@ -124,7 +124,6 @@ module Sc2
|
|
124
124
|
ensure
|
125
125
|
# noinspection RubyScope
|
126
126
|
socket&.close
|
127
|
-
false
|
128
127
|
end
|
129
128
|
end
|
130
129
|
end
|
@@ -136,7 +135,7 @@ module Sc2
|
|
136
135
|
def initialize(start_port:, num_players:, ports: [])
|
137
136
|
@start_port = start_port
|
138
137
|
@server_port_set = nil
|
139
|
-
@client_port_sets =
|
138
|
+
@client_port_sets = []
|
140
139
|
return if num_players <= 1
|
141
140
|
|
142
141
|
return if ports.empty?
|
@@ -6,39 +6,39 @@
|
|
6
6
|
# @!parse
|
7
7
|
# module Api;
|
8
8
|
# # Protobuf virtual class.
|
9
|
-
# class Color
|
9
|
+
# class Color end;
|
10
10
|
# # Protobuf virtual class.
|
11
|
-
# class Point
|
11
|
+
# class Point end;
|
12
12
|
# # Protobuf virtual class.
|
13
|
-
# class Point2D
|
13
|
+
# class Point2D end;
|
14
14
|
# # Protobuf virtual class.
|
15
|
-
# class PointI
|
15
|
+
# class PointI end;
|
16
16
|
# # Protobuf virtual class.
|
17
|
-
# class PowerSource
|
17
|
+
# class PowerSource end;
|
18
18
|
# # Protobuf virtual class.
|
19
|
-
# class Size2DI
|
19
|
+
# class Size2DI end;
|
20
20
|
# # Protobuf virtual class.
|
21
|
-
# class Point
|
21
|
+
# class Point end;
|
22
22
|
# # Protobuf virtual class.
|
23
|
-
# class Unit
|
23
|
+
# class Unit end;
|
24
24
|
# # Protobuf virtual class.
|
25
|
-
# class UnitTypeData
|
25
|
+
# class UnitTypeData end;
|
26
26
|
# # Protobuf virtual class.
|
27
|
-
# class AvailableAbility
|
27
|
+
# class AvailableAbility end;
|
28
28
|
# # Protobuf virtual class.
|
29
|
-
# class UnitOrder
|
29
|
+
# class UnitOrder end;
|
30
30
|
# # Protobuf virtual class.
|
31
|
-
# class ActionRawUnitCommand
|
31
|
+
# class ActionRawUnitCommand end;
|
32
32
|
# # Protobuf virtual class.
|
33
|
-
# class ActionRawToggleAutocast
|
33
|
+
# class ActionRawToggleAutocast end;
|
34
34
|
# # Protobuf virtual class.
|
35
|
-
# class ActionError
|
35
|
+
# class ActionError end;
|
36
36
|
# # Protobuf virtual class.
|
37
|
-
# class ActionSpatialUnitCommand
|
37
|
+
# class ActionSpatialUnitCommand end;
|
38
38
|
# # Protobuf virtual class.
|
39
|
-
# class BuildItem
|
39
|
+
# class BuildItem end;
|
40
40
|
# # Protobuf virtual class.
|
41
|
-
# class ActionToggleAutocast
|
41
|
+
# class ActionToggleAutocast end;
|
42
42
|
# end
|
43
43
|
|
44
44
|
|
@@ -47,13 +47,258 @@
|
|
47
47
|
# Protobuf classes
|
48
48
|
# @!parse
|
49
49
|
# module Api;
|
50
|
-
# #
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
50
|
+
# # PROTOBUF VIRTUAL ENUM.
|
51
|
+
# module Race
|
52
|
+
# NO_RACE = 0
|
53
|
+
# TERRAN = 1
|
54
|
+
# ZERG = 2
|
55
|
+
# PROTOSS = 3
|
56
|
+
# RANDOM = 4
|
57
|
+
# end
|
58
|
+
# # PROTOBUF VIRTUAL ENUM.
|
59
|
+
# module PlayerType
|
60
|
+
# PARTICIPANT = 1
|
61
|
+
# COMPUTER = 2
|
62
|
+
# OBSERVER = 3
|
63
|
+
# end
|
64
|
+
# # PROTOBUF VIRTUAL ENUM.
|
65
|
+
# module Difficulty
|
66
|
+
# VERY_EASY = 1
|
67
|
+
# EASY = 2
|
68
|
+
# MEDIUM = 3
|
69
|
+
# MEDIUM_HARD = 4
|
70
|
+
# HARD = 5
|
71
|
+
# HARDER = 6
|
72
|
+
# VERY_HARD = 7
|
73
|
+
# CHEAT_VISION = 8
|
74
|
+
# CHEAT_MONEY = 9
|
75
|
+
# CHEAT_INSANE = 10
|
76
|
+
# end
|
77
|
+
# # PROTOBUF VIRTUAL ENUM.
|
78
|
+
# module AIBuild
|
79
|
+
# RANDOM_BUILD = 1
|
80
|
+
# RUSH = 2
|
81
|
+
# TIMING = 3
|
82
|
+
# POWER = 4
|
83
|
+
# MACRO = 5
|
84
|
+
# AIR = 6
|
85
|
+
# end
|
86
|
+
# # PROTOBUF VIRTUAL ENUM.
|
87
|
+
# module ActionResult
|
88
|
+
# SUCCESS = 1;
|
89
|
+
# NOT_SUPPORTED = 2;
|
90
|
+
# ERROR = 3;
|
91
|
+
# CANT_QUEUE_THAT_ORDER = 4;
|
92
|
+
# RETRY = 5;
|
93
|
+
# COOLDOWN = 6;
|
94
|
+
# QUEUE_IS_FULL = 7;
|
95
|
+
# RALLY_QUEUE_IS_FULL = 8;
|
96
|
+
# NOT_ENOUGH_MINERALS = 9;
|
97
|
+
# NOT_ENOUGH_VESPENE = 10;
|
98
|
+
# NOT_ENOUGH_TERRAZINE = 11;
|
99
|
+
# NOT_ENOUGH_CUSTOM = 12;
|
100
|
+
# NOT_ENOUGH_FOOD = 13;
|
101
|
+
# FOOD_USAGE_IMPOSSIBLE = 14;
|
102
|
+
# NOT_ENOUGH_LIFE = 15;
|
103
|
+
# NOT_ENOUGH_SHIELDS = 16;
|
104
|
+
# NOT_ENOUGH_ENERGY = 17;
|
105
|
+
# LIFE_SUPPRESSED = 18;
|
106
|
+
# SHIELDS_SUPPRESSED = 19;
|
107
|
+
# ENERGY_SUPPRESSED = 20;
|
108
|
+
# NOT_ENOUGH_CHARGES = 21;
|
109
|
+
# CANT_ADD_MORE_CHARGES = 22;
|
110
|
+
# TOO_MUCH_MINERALS = 23;
|
111
|
+
# TOO_MUCH_VESPENE = 24;
|
112
|
+
# TOO_MUCH_TERRAZINE = 25;
|
113
|
+
# TOO_MUCH_CUSTOM = 26;
|
114
|
+
# TOO_MUCH_FOOD = 27;
|
115
|
+
# TOO_MUCH_LIFE = 28;
|
116
|
+
# TOO_MUCH_SHIELDS = 29;
|
117
|
+
# TOO_MUCH_ENERGY = 30;
|
118
|
+
# MUST_TARGET_UNIT_WITH_LIFE = 31;
|
119
|
+
# MUST_TARGET_UNIT_WITH_SHIELDS = 32;
|
120
|
+
# MUST_TARGET_UNIT_WITH_ENERGY = 33;
|
121
|
+
# CANT_TRADE = 34;
|
122
|
+
# CANT_SPEND = 35;
|
123
|
+
# CANT_TARGET_THAT_UNIT = 36;
|
124
|
+
# COULDNT_ALLOCATE_UNIT = 37;
|
125
|
+
# UNIT_CANT_MOVE = 38;
|
126
|
+
# TRANSPORT_IS_HOLDING_POSITION = 39;
|
127
|
+
# BUILD_TECH_REQUIREMENTS_NOT_MET = 40;
|
128
|
+
# CANT_FIND_PLACEMENT_LOCATION = 41;
|
129
|
+
# CANT_BUILD_ON_THAT = 42;
|
130
|
+
# CANT_BUILD_TOO_CLOSE_TO_DROP_OFF = 43;
|
131
|
+
# CANT_BUILD_LOCATION_INVALID = 44;
|
132
|
+
# CANT_SEE_BUILD_LOCATION = 45;
|
133
|
+
# CANT_BUILD_TOO_CLOSE_TO_CREEP_SOURCE = 46;
|
134
|
+
# CANT_BUILD_TOO_CLOSE_TO_RESOURCES = 47;
|
135
|
+
# CANT_BUILD_TOO_FAR_FROM_WATER = 48;
|
136
|
+
# CANT_BUILD_TOO_FAR_FROM_CREEP_SOURCE = 49;
|
137
|
+
# CANT_BUILD_TOO_FAR_FROM_BUILD_POWER_SOURCE = 50;
|
138
|
+
# CANT_BUILD_ON_DENSE_TERRAIN = 51;
|
139
|
+
# CANT_TRAIN_TOO_FAR_FROM_TRAIN_POWER_SOURCE = 52;
|
140
|
+
# CANT_LAND_LOCATION_INVALID = 53;
|
141
|
+
# CANT_SEE_LAND_LOCATION = 54;
|
142
|
+
# CANT_LAND_TOO_CLOSE_TO_CREEP_SOURCE = 55;
|
143
|
+
# CANT_LAND_TOO_CLOSE_TO_RESOURCES = 56;
|
144
|
+
# CANT_LAND_TOO_FAR_FROM_WATER = 57;
|
145
|
+
# CANT_LAND_TOO_FAR_FROM_CREEP_SOURCE = 58;
|
146
|
+
# CANT_LAND_TOO_FAR_FROM_BUILD_POWER_SOURCE = 59;
|
147
|
+
# CANT_LAND_TOO_FAR_FROM_TRAIN_POWER_SOURCE = 60;
|
148
|
+
# CANT_LAND_ON_DENSE_TERRAIN = 61;
|
149
|
+
# ADD_ON_TOO_FAR_FROM_BUILDING = 62;
|
150
|
+
# MUST_BUILD_REFINERY_FIRST = 63;
|
151
|
+
# BUILDING_IS_UNDER_CONSTRUCTION = 64;
|
152
|
+
# CANT_FIND_DROP_OFF = 65;
|
153
|
+
# CANT_LOAD_OTHER_PLAYERS_UNITS = 66;
|
154
|
+
# NOT_ENOUGH_ROOM_TO_LOAD_UNIT = 67;
|
155
|
+
# CANT_UNLOAD_UNITS_THERE = 68;
|
156
|
+
# CANT_WARP_IN_UNITS_THERE = 69;
|
157
|
+
# CANT_LOAD_IMMOBILE_UNITS = 70;
|
158
|
+
# CANT_RECHARGE_IMMOBILE_UNITS = 71;
|
159
|
+
# CANT_RECHARGE_UNDER_CONSTRUCTION_UNITS = 72;
|
160
|
+
# CANT_LOAD_THAT_UNIT = 73;
|
161
|
+
# NO_CARGO_TO_UNLOAD = 74;
|
162
|
+
# LOAD_ALL_NO_TARGETS_FOUND = 75;
|
163
|
+
# NOT_WHILE_OCCUPIED = 76;
|
164
|
+
# CANT_ATTACK_WITHOUT_AMMO = 77;
|
165
|
+
# CANT_HOLD_ANY_MORE_AMMO = 78;
|
166
|
+
# TECH_REQUIREMENTS_NOT_MET = 79;
|
167
|
+
# MUST_LOCKDOWN_UNIT_FIRST = 80;
|
168
|
+
# MUST_TARGET_UNIT = 81;
|
169
|
+
# MUST_TARGET_INVENTORY = 82;
|
170
|
+
# MUST_TARGET_VISIBLE_UNIT = 83;
|
171
|
+
# MUST_TARGET_VISIBLE_LOCATION = 84;
|
172
|
+
# MUST_TARGET_WALKABLE_LOCATION = 85;
|
173
|
+
# MUST_TARGET_PAWNABLE_UNIT = 86;
|
174
|
+
# YOU_CANT_CONTROL_THAT_UNIT = 87;
|
175
|
+
# YOU_CANT_ISSUE_COMMANDS_TO_THAT_UNIT = 88;
|
176
|
+
# MUST_TARGET_RESOURCES = 89;
|
177
|
+
# REQUIRES_HEAL_TARGET = 90;
|
178
|
+
# REQUIRES_REPAIR_TARGET = 91;
|
179
|
+
# NO_ITEMS_TO_DROP = 92;
|
180
|
+
# CANT_HOLD_ANY_MORE_ITEMS = 93;
|
181
|
+
# CANT_HOLD_THAT = 94;
|
182
|
+
# TARGET_HAS_NO_INVENTORY = 95;
|
183
|
+
# CANT_DROP_THIS_ITEM = 96;
|
184
|
+
# CANT_MOVE_THIS_ITEM = 97;
|
185
|
+
# CANT_PAWN_THIS_UNIT = 98;
|
186
|
+
# MUST_TARGET_CASTER = 99;
|
187
|
+
# CANT_TARGET_CASTER = 100;
|
188
|
+
# MUST_TARGET_OUTER = 101;
|
189
|
+
# CANT_TARGET_OUTER = 102;
|
190
|
+
# MUST_TARGET_YOUR_OWN_UNITS = 103;
|
191
|
+
# CANT_TARGET_YOUR_OWN_UNITS = 104;
|
192
|
+
# MUST_TARGET_FRIENDLY_UNITS = 105;
|
193
|
+
# CANT_TARGET_FRIENDLY_UNITS = 106;
|
194
|
+
# MUST_TARGET_NEUTRAL_UNITS = 107;
|
195
|
+
# CANT_TARGET_NEUTRAL_UNITS = 108;
|
196
|
+
# MUST_TARGET_ENEMY_UNITS = 109;
|
197
|
+
# CANT_TARGET_ENEMY_UNITS = 110;
|
198
|
+
# MUST_TARGET_AIR_UNITS = 111;
|
199
|
+
# CANT_TARGET_AIR_UNITS = 112;
|
200
|
+
# MUST_TARGET_GROUND_UNITS = 113;
|
201
|
+
# CANT_TARGET_GROUND_UNITS = 114;
|
202
|
+
# MUST_TARGET_STRUCTURES = 115;
|
203
|
+
# CANT_TARGET_STRUCTURES = 116;
|
204
|
+
# MUST_TARGET_LIGHT_UNITS = 117;
|
205
|
+
# CANT_TARGET_LIGHT_UNITS = 118;
|
206
|
+
# MUST_TARGET_ARMORED_UNITS = 119;
|
207
|
+
# CANT_TARGET_ARMORED_UNITS = 120;
|
208
|
+
# MUST_TARGET_BIOLOGICAL_UNITS = 121;
|
209
|
+
# CANT_TARGET_BIOLOGICAL_UNITS = 122;
|
210
|
+
# MUST_TARGET_HEROIC_UNITS = 123;
|
211
|
+
# CANT_TARGET_HEROIC_UNITS = 124;
|
212
|
+
# MUST_TARGET_ROBOTIC_UNITS = 125;
|
213
|
+
# CANT_TARGET_ROBOTIC_UNITS = 126;
|
214
|
+
# MUST_TARGET_MECHANICAL_UNITS = 127;
|
215
|
+
# CANT_TARGET_MECHANICAL_UNITS = 128;
|
216
|
+
# MUST_TARGET_PSIONIC_UNITS = 129;
|
217
|
+
# CANT_TARGET_PSIONIC_UNITS = 130;
|
218
|
+
# MUST_TARGET_MASSIVE_UNITS = 131;
|
219
|
+
# CANT_TARGET_MASSIVE_UNITS = 132;
|
220
|
+
# MUST_TARGET_MISSILE = 133;
|
221
|
+
# CANT_TARGET_MISSILE = 134;
|
222
|
+
# MUST_TARGET_WORKER_UNITS = 135;
|
223
|
+
# CANT_TARGET_WORKER_UNITS = 136;
|
224
|
+
# MUST_TARGET_ENERGY_CAPABLE_UNITS = 137;
|
225
|
+
# CANT_TARGET_ENERGY_CAPABLE_UNITS = 138;
|
226
|
+
# MUST_TARGET_SHIELD_CAPABLE_UNITS = 139;
|
227
|
+
# CANT_TARGET_SHIELD_CAPABLE_UNITS = 140;
|
228
|
+
# MUST_TARGET_FLYERS = 141;
|
229
|
+
# CANT_TARGET_FLYERS = 142;
|
230
|
+
# MUST_TARGET_BURIED_UNITS = 143;
|
231
|
+
# CANT_TARGET_BURIED_UNITS = 144;
|
232
|
+
# MUST_TARGET_CLOAKED_UNITS = 145;
|
233
|
+
# CANT_TARGET_CLOAKED_UNITS = 146;
|
234
|
+
# MUST_TARGET_UNITS_IN_A_STASIS_FIELD = 147;
|
235
|
+
# CANT_TARGET_UNITS_IN_A_STASIS_FIELD = 148;
|
236
|
+
# MUST_TARGET_UNDER_CONSTRUCTION_UNITS = 149;
|
237
|
+
# CANT_TARGET_UNDER_CONSTRUCTION_UNITS = 150;
|
238
|
+
# MUST_TARGET_DEAD_UNITS = 151;
|
239
|
+
# CANT_TARGET_DEAD_UNITS = 152;
|
240
|
+
# MUST_TARGET_REVIVABLE_UNITS = 153;
|
241
|
+
# CANT_TARGET_REVIVABLE_UNITS = 154;
|
242
|
+
# MUST_TARGET_HIDDEN_UNITS = 155;
|
243
|
+
# CANT_TARGET_HIDDEN_UNITS = 156;
|
244
|
+
# CANT_RECHARGE_OTHER_PLAYERS_UNITS = 157;
|
245
|
+
# MUST_TARGET_HALLUCINATIONS = 158;
|
246
|
+
# CANT_TARGET_HALLUCINATIONS = 159;
|
247
|
+
# MUST_TARGET_INVULNERABLE_UNITS = 160;
|
248
|
+
# CANT_TARGET_INVULNERABLE_UNITS = 161;
|
249
|
+
# MUST_TARGET_DETECTED_UNITS = 162;
|
250
|
+
# CANT_TARGET_DETECTED_UNITS = 163;
|
251
|
+
# CANT_TARGET_UNIT_WITH_ENERGY = 164;
|
252
|
+
# CANT_TARGET_UNIT_WITH_SHIELDS = 165;
|
253
|
+
# MUST_TARGET_UNCOMMANDABLE_UNITS = 166;
|
254
|
+
# CANT_TARGET_UNCOMMANDABLE_UNITS = 167;
|
255
|
+
# MUST_TARGET_PREVENT_DEFEAT_UNITS = 168;
|
256
|
+
# CANT_TARGET_PREVENT_DEFEAT_UNITS = 169;
|
257
|
+
# MUST_TARGET_PREVENT_REVEAL_UNITS = 170;
|
258
|
+
# CANT_TARGET_PREVENT_REVEAL_UNITS = 171;
|
259
|
+
# MUST_TARGET_PASSIVE_UNITS = 172;
|
260
|
+
# CANT_TARGET_PASSIVE_UNITS = 173;
|
261
|
+
# MUST_TARGET_STUNNED_UNITS = 174;
|
262
|
+
# CANT_TARGET_STUNNED_UNITS = 175;
|
263
|
+
# MUST_TARGET_SUMMONED_UNITS = 176;
|
264
|
+
# CANT_TARGET_SUMMONED_UNITS = 177;
|
265
|
+
# MUST_TARGET_USER1 = 178;
|
266
|
+
# CANT_TARGET_USER1 = 179;
|
267
|
+
# MUST_TARGET_UNSTOPPABLE_UNITS = 180;
|
268
|
+
# CANT_TARGET_UNSTOPPABLE_UNITS = 181;
|
269
|
+
# MUST_TARGET_RESISTANT_UNITS = 182;
|
270
|
+
# CANT_TARGET_RESISTANT_UNITS = 183;
|
271
|
+
# MUST_TARGET_DAZED_UNITS = 184;
|
272
|
+
# CANT_TARGET_DAZED_UNITS = 185;
|
273
|
+
# CANT_LOCKDOWN = 186;
|
274
|
+
# CANT_MIND_CONTROL = 187;
|
275
|
+
# MUST_TARGET_DESTRUCTIBLES = 188;
|
276
|
+
# CANT_TARGET_DESTRUCTIBLES = 189;
|
277
|
+
# MUST_TARGET_ITEMS = 190;
|
278
|
+
# CANT_TARGET_ITEMS = 191;
|
279
|
+
# NO_CALLDOWN_AVAILABLE = 192;
|
280
|
+
# WAYPOINT_LIST_FULL = 193;
|
281
|
+
# MUST_TARGET_RACE = 194;
|
282
|
+
# CANT_TARGET_RACE = 195;
|
283
|
+
# MUST_TARGET_SIMILAR_UNITS = 196;
|
284
|
+
# CANT_TARGET_SIMILAR_UNITS = 197;
|
285
|
+
# CANT_FIND_ENOUGH_TARGETS = 198;
|
286
|
+
# ALREADY_SPAWNING_LARVA = 199;
|
287
|
+
# CANT_TARGET_EXHAUSTED_RESOURCES = 200;
|
288
|
+
# CANT_USE_MINIMAP = 201;
|
289
|
+
# CANT_USE_INFO_PANEL = 202;
|
290
|
+
# ORDER_QUEUE_IS_FULL = 203;
|
291
|
+
# CANT_HARVEST_THAT_RESOURCE = 204;
|
292
|
+
# HARVESTERS_NOT_REQUIRED = 205;
|
293
|
+
# ALREADY_TARGETED = 206;
|
294
|
+
# CANT_ATTACK_WEAPONS_DISABLED = 207;
|
295
|
+
# COULDNT_REACH_TARGET = 208;
|
296
|
+
# TARGET_IS_OUT_OF_RANGE = 209;
|
297
|
+
# TARGET_IS_TOO_CLOSE = 210;
|
298
|
+
# TARGET_IS_OUT_OF_ARC = 211;
|
299
|
+
# CANT_FIND_TELEPORT_LOCATION = 212;
|
300
|
+
# INVALID_ITEM_CLASS = 213;
|
301
|
+
# CANT_FIND_CANCEL_ORDER = 214;
|
302
|
+
# end
|
58
303
|
# end
|
59
304
|
# @!parse
|