mrpin-sdk 1.0.64 → 1.0.65
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/mrpin-sdk.gemspec +1 -1
- metadata +3 -6
- data/lib/mrpin/api/platform/report/handler_report_error.rb +0 -73
- data/lib/mrpin/api/platform/report/request_report_error.rb +0 -20
- data/lib/mrpin/core/statistic/error_client_base.rb +0 -136
- /data/lib/mrpin/core/{statistic → error}/error_server_base.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 281306f2abaa9c0e69658e7555aaf80ee46ab8c1
|
|
4
|
+
data.tar.gz: 021636d74f53b78e3dd9a14c035d17dbe0eaa7e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4988474f968870bd3c6cf092869d0b1b4f94906a03537cc42226d8d0b292cd10e170e447a5f973e094a16289778153399dd043f89c576d9dd7e978f94314062a
|
|
7
|
+
data.tar.gz: 7b98475455c8c9d8c5a6d4dcdce11cdcca6c88bbd95b4d024d0439963ced13306cdd2c88c60dde08226faffbf04a16655b7c71bd4a64b9bed0e4f2de62c4db7d
|
data/mrpin-sdk.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'mrpin-sdk'
|
|
7
|
-
spec.version = '1.0.
|
|
7
|
+
spec.version = '1.0.65'
|
|
8
8
|
spec.authors = %w(Gregory Tkach Yakupov Dmitrij)
|
|
9
9
|
spec.email = %w(gregory.tkach@gmail.com yakupov.dmitrij@gmail.com)
|
|
10
10
|
spec.description = %q{Mrpin sdk for backend development.}
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mrpin-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.65
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gregory
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2017-05-
|
|
14
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -351,8 +351,6 @@ files:
|
|
|
351
351
|
- lib/mrpin/api/packs/responses_pack.rb
|
|
352
352
|
- lib/mrpin/api/platform/base/handler_platform_base.rb
|
|
353
353
|
- lib/mrpin/api/platform/base/request_platform_base.rb
|
|
354
|
-
- lib/mrpin/api/platform/report/handler_report_error.rb
|
|
355
|
-
- lib/mrpin/api/platform/report/request_report_error.rb
|
|
356
354
|
- lib/mrpin/api/standard/response_error.rb
|
|
357
355
|
- lib/mrpin/api/standard/response_ok.rb
|
|
358
356
|
- lib/mrpin/api/standard/response_session_end.rb
|
|
@@ -390,6 +388,7 @@ files:
|
|
|
390
388
|
- lib/mrpin/core/currency_exchanger/fixer/exchanger_fixer.rb
|
|
391
389
|
- lib/mrpin/core/currency_exchanger/local/exchanger_local.rb
|
|
392
390
|
- lib/mrpin/core/currency_exchanger/yahoo/exchanger_yahoo.rb
|
|
391
|
+
- lib/mrpin/core/error/error_server_base.rb
|
|
393
392
|
- lib/mrpin/core/exceptions/assertion_error.rb
|
|
394
393
|
- lib/mrpin/core/extensions/hash.rb
|
|
395
394
|
- lib/mrpin/core/extensions/mongoid_id_alias.rb
|
|
@@ -420,8 +419,6 @@ files:
|
|
|
420
419
|
- lib/mrpin/core/remote/socket/websocket/socket_client_web_sockets.rb
|
|
421
420
|
- lib/mrpin/core/review.rb
|
|
422
421
|
- lib/mrpin/core/scheduler/manager_scheduler.rb
|
|
423
|
-
- lib/mrpin/core/statistic/error_client_base.rb
|
|
424
|
-
- lib/mrpin/core/statistic/error_server_base.rb
|
|
425
422
|
- lib/mrpin/core/statistic/manager_statistics_base.rb
|
|
426
423
|
- lib/mrpin/core/statistic/statistic_application_base.rb
|
|
427
424
|
- lib/mrpin/core/statistic/statistic_config_base.rb
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
module Api
|
|
2
|
-
#todo:review and implement
|
|
3
|
-
class HandlerReportError < HandlerBase
|
|
4
|
-
|
|
5
|
-
#
|
|
6
|
-
# Properties
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
#
|
|
10
|
-
# Methods
|
|
11
|
-
#
|
|
12
|
-
|
|
13
|
-
# default constructor
|
|
14
|
-
def initialize(options = nil)
|
|
15
|
-
super(options)
|
|
16
|
-
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
public
|
|
20
|
-
def handle_request(session, request)
|
|
21
|
-
super
|
|
22
|
-
|
|
23
|
-
#get player id at first, because client will disconnect after report error
|
|
24
|
-
player_id = 'unknown'
|
|
25
|
-
|
|
26
|
-
unless session.player.nil?
|
|
27
|
-
player_id = session.player.id
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
md5 = Digest::MD5.hexdigest("#{request.message}#{request.stack_trace}")
|
|
31
|
-
|
|
32
|
-
error = ErrorClientBase.where(md5: md5).first
|
|
33
|
-
|
|
34
|
-
if error.nil?
|
|
35
|
-
#create
|
|
36
|
-
error = ErrorClientBase.new
|
|
37
|
-
error.first_error_at = Time.now.to_i
|
|
38
|
-
error.message = request.message
|
|
39
|
-
error.stack_trace = request.stack_trace
|
|
40
|
-
error.md5 = md5
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
if error.logs_to_save_left > 0
|
|
44
|
-
|
|
45
|
-
player_logs = request.logs
|
|
46
|
-
|
|
47
|
-
bucket_name = nil
|
|
48
|
-
file_path = "#{AppInfo.instance.server_name}/logs/errors/#{md5}_md5"
|
|
49
|
-
file_name = "#{player_id}_#{Time.now.to_i}.log"
|
|
50
|
-
|
|
51
|
-
s3_key = File.join(file_path, file_name)
|
|
52
|
-
|
|
53
|
-
# file_info = @aws_uploader.upload_data_to_s3(player_logs, bucket_name, s3_key)
|
|
54
|
-
#
|
|
55
|
-
# error.logs_files << file_info.url_s3
|
|
56
|
-
#
|
|
57
|
-
# error.logs_to_save_left = error.logs_to_save_left - 1
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
player_errors_count = error.players_ids_map[player_id] || 0
|
|
61
|
-
|
|
62
|
-
error.last_error_at = Time.now.to_i
|
|
63
|
-
error.players_ids_map[player_id] = player_errors_count + 1
|
|
64
|
-
error.throws_count += 1
|
|
65
|
-
error.players_count = error.players_ids_map.size
|
|
66
|
-
|
|
67
|
-
error.save!
|
|
68
|
-
|
|
69
|
-
session.send_response_ok(request.request_id)
|
|
70
|
-
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module Api
|
|
2
|
-
class RequestReportError < RequestBase
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# Properties
|
|
6
|
-
#
|
|
7
|
-
attr_accessor :message
|
|
8
|
-
attr_accessor :stack_trace
|
|
9
|
-
attr_accessor :logs
|
|
10
|
-
|
|
11
|
-
#
|
|
12
|
-
# Methods
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
# default constructor
|
|
16
|
-
def initialize(options = nil)
|
|
17
|
-
super(options)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
class ErrorClientBase < ModelBase
|
|
2
|
-
|
|
3
|
-
include Mongoid::Document
|
|
4
|
-
prepend MongoidIdAlias
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
# Static Methods
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
public
|
|
11
|
-
def self.configure_admin_list(section, field_name)
|
|
12
|
-
|
|
13
|
-
case field_name
|
|
14
|
-
when :_id, :md5, :logs_to_save_left, :logs_files, :stack_trace
|
|
15
|
-
section.configure field_name do
|
|
16
|
-
visible false
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
when :throws_count, :players_count
|
|
20
|
-
section.configure field_name do
|
|
21
|
-
column_width 60
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
else
|
|
25
|
-
super(section, field_name)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
public
|
|
31
|
-
def self.sort_by_for_admin_list(section)
|
|
32
|
-
|
|
33
|
-
section.sort_by :last_error_at
|
|
34
|
-
section.configure :last_error_at do
|
|
35
|
-
sort_reverse true
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
public
|
|
41
|
-
def self.configure_admin_show(section, field_name)
|
|
42
|
-
|
|
43
|
-
case field_name
|
|
44
|
-
when :logs_files
|
|
45
|
-
section.configure field_name do
|
|
46
|
-
|
|
47
|
-
pretty_value do
|
|
48
|
-
|
|
49
|
-
logs_files = bindings[:object].logs_files
|
|
50
|
-
|
|
51
|
-
result = []
|
|
52
|
-
|
|
53
|
-
log_index = 1
|
|
54
|
-
|
|
55
|
-
logs_files.each do |url_log|
|
|
56
|
-
|
|
57
|
-
result << bindings[:view].link_to("log_file_#{log_index}", url_log.html_safe)
|
|
58
|
-
|
|
59
|
-
log_index += 1
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
result.join('<br>').html_safe
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
when :stack_trace
|
|
66
|
-
section.configure field_name do
|
|
67
|
-
pretty_value do
|
|
68
|
-
value.join('<br>').html_safe
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
else
|
|
73
|
-
superclass.configure_admin_show(section, field_name)
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
#
|
|
79
|
-
# callbacks
|
|
80
|
-
#
|
|
81
|
-
|
|
82
|
-
before_destroy :cleanup_logs
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
# db
|
|
86
|
-
#
|
|
87
|
-
|
|
88
|
-
store_in collection: 'system_error_clients'
|
|
89
|
-
|
|
90
|
-
#
|
|
91
|
-
# fields
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
#md5 from message + stack
|
|
95
|
-
field :md5
|
|
96
|
-
|
|
97
|
-
field :last_error_at, type: Integer
|
|
98
|
-
field :first_error_at, type: Integer
|
|
99
|
-
field :message, type: String
|
|
100
|
-
field :players_ids_map, type: Hash, default: {}
|
|
101
|
-
|
|
102
|
-
field :throws_count, type: Integer, default: 0
|
|
103
|
-
field :players_count, type: Integer, default: 0
|
|
104
|
-
|
|
105
|
-
field :stack_trace, type: String
|
|
106
|
-
|
|
107
|
-
field :logs_to_save_left, type: Integer, default: 10
|
|
108
|
-
field :logs_files, type: Array, default: []
|
|
109
|
-
|
|
110
|
-
#
|
|
111
|
-
# add indexes
|
|
112
|
-
#
|
|
113
|
-
|
|
114
|
-
index(md5: 1)
|
|
115
|
-
|
|
116
|
-
#
|
|
117
|
-
# Methods
|
|
118
|
-
#
|
|
119
|
-
|
|
120
|
-
# default constructor
|
|
121
|
-
def initialize(options = nil)
|
|
122
|
-
super(options)
|
|
123
|
-
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
private
|
|
127
|
-
def cleanup_logs
|
|
128
|
-
#todo:review
|
|
129
|
-
# aws_uploader = AppInfo.instance.aws_uploader
|
|
130
|
-
#
|
|
131
|
-
# self.logs_files.each do |url_log_file|
|
|
132
|
-
# aws_uploader.delete_file_from_s3_by_uri(nil, url_log_file)
|
|
133
|
-
# end
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
end
|
|
File without changes
|