diff --git a/conf/config.yaml b/conf/config.yaml index 019b2da24ce2af409e5667660129818982386b2d..7424243db5e12cc023d4f1471d927b5884d94791 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -9,7 +9,7 @@ :restart_delay: 10 :address: 0.0.0.0 :intro_file: intro.txt -:start_room: c1551b23-e2ef-628a-a7d9-e76a68d2e789 +:start_room: fc511e2c-863e-daf1-87be-6214f59c013a :restart_limit: 15 :mccp: false :mssp: false diff --git a/lib/aethyr/core/connection/login.rb b/lib/aethyr/core/connection/login.rb index 8f7059aa5fb66be577398855d82400f1141224b6..6d9b73d11a503a3444212bbf799588d7b84d7aff 100644 --- a/lib/aethyr/core/connection/login.rb +++ b/lib/aethyr/core/connection/login.rb @@ -159,12 +159,8 @@ module Login return end - - @display.color_settings = player.color_settings unless player.color_settings.nil? - @display.layout(layout: player.layout, in_combat: player.info.in_combat) unless player.layout.nil? - @word_wrap = player.word_wrap - player.instance_variable_set(:@player, self) + player.set_connection(self) $manager.add_object(player) @player = player diff --git a/lib/aethyr/core/objects/player.rb b/lib/aethyr/core/objects/player.rb index c45f4c01d4b89cbb3c53bfc8fe73e52c84ef6be8..a7c433bbdc05d1d21915cb62f6a3e633735fb277 100644 --- a/lib/aethyr/core/objects/player.rb +++ b/lib/aethyr/core/objects/player.rb @@ -71,6 +71,12 @@ class Player < LivingObject map_skill.add_xp 750 end + def set_connection(new_player) + @player = new_player + @player.display.color_settings = @color_settings + @player.display.layout(layout: @layout) + end + #called right before saving to temporarily remove volatile data. def dehydrate volatile_data = super() @@ -85,11 +91,12 @@ class Player < LivingObject end def layout - return nil if @player.display.nil? + return @layout if @player.display.nil? return @player.display.layout_type end def layout= new_layout + @layout = new_layout @player.display.layout(layout: new_layout) @player.display.refresh_watch_windows(self) end @@ -190,12 +197,6 @@ class Player < LivingObject end end - #Just outputs a message to the player that we don't know what - #to do with the method call. - def method_missing(*args) - self.output("Don't know what do to with: #{args.inspect}") - end - #Handles the input from the Player. Basically, it just takes the #input, feeds it to the CommandParser, then sends the event #(if any) to the Manager.